Giter VIP home page Giter VIP logo

firebrew's People

Contributors

mrk21 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

firebrew's Issues

The `OptionParser` exceptions has not been handled enough.

The error shown below:

$ bundle exec ./bin/firebrew -f
#<OptionParser::MissingArgument: -f>
firebrew/lib/firebrew/command_line.rb:120:in `opt_operation'
firebrew/lib/firebrew/command_line.rb:63:in `initialize'
firebrew/lib/firebrew/command_line.rb:13:in `new'
firebrew/lib/firebrew/command_line.rb:13:in `execute'
./bin/firebrew:5:in `<main>'
#

In the current implementation. has been handle only the OptionParser::InvalidOption exception, so will handle the all OptionParser exceptions.

Fix the README.

Will fix the points listed below:

  • To execution is required the OpenSSL.
  • The default values of the configs for the Windows.

Write the README.

The contents of the README is listed below:

  • Command usage
  • Environment variables

If the `install` element of the extension which was got by the generic AMO API was equal or greater than two, then occurs errors.

The occurred errors listed below:

$ firebrew install 'Hatena Bookmark'
#<TypeError: no implicit conversion of Array into String>
lib/ruby/2.1.0/open-uri.rb:36:in `open'
lib/ruby/2.1.0/open-uri.rb:36:in `open'
lib/ruby/gems/2.1.0/gems/firebrew-0.1.1/lib/firebrew/firefox/extension.rb:45:in `install'
lib/ruby/gems/2.1.0/gems/firebrew-0.1.1/lib/firebrew/runner.rb:55:in `install'
lib/ruby/gems/2.1.0/gems/firebrew-0.1.1/lib/firebrew/command_line.rb:112:in `execute'
lib/ruby/gems/2.1.0/gems/firebrew-0.1.1/lib/firebrew/command_line.rb:12:in `execute'
lib/ruby/gems/2.1.0/gems/firebrew-0.1.1/bin/firebrew:5:in `<top (required)>'
bin/firebrew:23:in `load'
bin/firebrew:23:in `<main>'

In the current implementation, it has not assuming a case of when the install element was equal or greater than two, so it will change as choosing a first element in the install elements.

The unit test failed on the Windows(#10): The first error.

The error message in the issue #10:

  1) Firebrew::Firefox::Profile Manager #all() should construct records
     Failure/Error: expect(subject[2].path).to eq('/path/to/abs_profile')

       expected: "/path/to/abs_profile"
            got: "Z:/path/to/abs_profile"

       (compared using ==)
     # ./spec/firebrew/firefox/profile_spec.rb:36:in `block (4 levels) in <module:Firefox>'

It should be changed as shown below:

before:

expect(subject[2].path).to eq('/path/to/abs_profile')

after:

expect(subject[2].path).to eq(File.expand_path('/path/to/abs_profile'))

The unit test failed on the Windows(#10): The 2 to 5 errors.

The error messages in the issue #10:

  2) Firebrew::Runner Instance #install(params) should not raise Exception
     Failure/Error: it { expect{subject}.to_not raise_error }
       expected no Exception, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:160:in `block (4 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:164:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:164:in `block (4 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:164:in `block (4 levels) in <module:Firebrew>'

  3) Firebrew::Runner Instance #install(params) when the `params[:term]` existed should raise Firebrew::OperationAlreadyCompletedError
     Failure/Error: it { expect{subject}.to raise_error(Firebrew::OperationAlreadyCompletedError) }
       expected Firebrew::OperationAlreadyCompletedError, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:169:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:173:in `block (6 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:173:in `block (5 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:173:in `block (5 levels) in <module:Firebrew>'

  4) Firebrew::Runner Instance #uninstall(params) should not raise Exception
     Failure/Error: it { expect{subject}.to_not raise_error }
       expected no Exception, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:180:in `block (4 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:184:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:184:in `block (4 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:184:in `block (4 levels) in <module:Firebrew>'

  5) Firebrew::Runner Instance #uninstall(params) when the `params[:term]` not existed should raise Firebrew::OperationAlreadyCompletedError
     Failure/Error: it { expect{subject}.to raise_error(Firebrew::OperationAlreadyCompletedError) }
       expected Firebrew::OperationAlreadyCompletedError, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:190:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:194:in `block (6 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:194:in `block (5 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:194:in `block (5 levels) in <module:Firebrew>'

The reason it occurs the above errors is that the Firefox command path contains spaces. Therefore, will wrap that by double quotations shown below:

before:

result = @executer.exec('%{firefox} --version' % @config)

after:

result = @executer.exec('"%{firefox}" --version' % @config)

Not working on Debian Jessie (Iceweasel)

Hello,

I'm trying to use firebrew on Debian Jessie, which is shipped with Iceweasel. I thought that firebrew would work since Iceweasel seems to be a modified Firefox however it doesn't work. The error is:

# Error
[afu:~]$ firebrew info
(process:25628): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Command is not Firefox: /usr/bin/firefox

# Trying with the profile
[afu:~]$ firebrew -d ~/.mozilla/firefox info
(process:25923): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Command is not Firefox: /usr/bin/firefox

# Trying especifying the binary
[afu:~]$ firebrew -f /usr/bin/firefox info  
(process:25951): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Command is not Firefox: /usr/bin/firefox

# Trying especifying the iceweasel binary
[afu:~]$ firebrew -f /usr/bin/iceweasel info 
(process:26087): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
Command is not Firefox: /usr/bin/iceweasel

# Firefox alias available at /usr/bin/firefox
[afu:~]$ which firefox
/usr/bin/firefox

Any idea?

Thank you very much.

The unit test failed on the Windows.

The error messages are shown below:

  1) Firebrew::Firefox::Profile Manager #all() should construct records
     Failure/Error: expect(subject[2].path).to eq('/path/to/abs_profile')

       expected: "/path/to/abs_profile"
            got: "Z:/path/to/abs_profile"

       (compared using ==)
     # ./spec/firebrew/firefox/profile_spec.rb:36:in `block (4 levels) in <module:Firefox>'

  2) Firebrew::Runner Instance #install(params) should not raise Exception
     Failure/Error: it { expect{subject}.to_not raise_error }
       expected no Exception, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:160:in `block (4 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:164:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:164:in `block (4 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:164:in `block (4 levels) in <module:Firebrew>'

  3) Firebrew::Runner Instance #install(params) when the `params[:term]` existed should raise Firebrew::OperationAlreadyCompletedError
     Failure/Error: it { expect{subject}.to raise_error(Firebrew::OperationAlreadyCompletedError) }
       expected Firebrew::OperationAlreadyCompletedError, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:169:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:173:in `block (6 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:173:in `block (5 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:173:in `block (5 levels) in <module:Firebrew>'

  4) Firebrew::Runner Instance #uninstall(params) should not raise Exception
     Failure/Error: it { expect{subject}.to_not raise_error }
       expected no Exception, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:180:in `block (4 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:184:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:184:in `block (4 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:184:in `block (4 levels) in <module:Firebrew>'

  5) Firebrew::Runner Instance #uninstall(params) when the `params[:term]` not existed should raise Firebrew::OperationAlreadyCompletedError
     Failure/Error: it { expect{subject}.to raise_error(Firebrew::OperationAlreadyCompletedError) }
       expected Firebrew::OperationAlreadyCompletedError, got #<Firebrew::FirefoxCommandError: Firebrew::FirefoxCommandError> with backtrace:
         # ./lib/firebrew/firefox/command.rb:17:in `rescue in initialize'
         # ./lib/firebrew/firefox/command.rb:12:in `initialize'
         # ./lib/firebrew/runner.rb:42:in `new'
         # ./lib/firebrew/runner.rb:42:in `initialize'
         # ./spec/firebrew/runner_spec.rb:135:in `new'
         # ./spec/firebrew/runner_spec.rb:135:in `block (3 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:190:in `block (5 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:194:in `block (6 levels) in <module:Firebrew>'
         # ./spec/firebrew/runner_spec.rb:194:in `block (5 levels) in <module:Firebrew>'
     # ./spec/firebrew/runner_spec.rb:194:in `block (5 levels) in <module:Firebrew>'

Finished in 6.07 seconds (files took 18.39 seconds to load)
72 examples, 5 failures

Failed examples:

rspec ./spec/firebrew/firefox/profile_spec.rb:26 # Firebrew::Firefox::Profile Manager #all() should construct records
rspec ./spec/firebrew/runner_spec.rb:164 # Firebrew::Runner Instance #install(params) should not raise Exception
rspec ./spec/firebrew/runner_spec.rb:173 # Firebrew::Runner Instance #install(params) when the `params[:term]` existed should raise Firebrew::OperationAlreadyCompletedError
rspec ./spec/firebrew/runner_spec.rb:184 # Firebrew::Runner Instance #uninstall(params) should not raise Exception
rspec ./spec/firebrew/runner_spec.rb:194 # Firebrew::Runner Instance #uninstall(params) when the `params[:term]` not existed should raise Firebrew::OperationAlreadyCompletedError

Improve the help message.

The currently help message is inadequacy, so it change as shown below:

$ firebrew --help
Usage: firebrew [options] command
commands:
    install:
        firebrew install extension-name

    uninstall:
        firebrew uninstall extension-name

    info:
        firebrew info extension-name

    search:
        firebrew search term

    list:
        firebrew list

options:
    -d, --base-dir=path              Firefox profiles.ini directory
    -p, --profile=name               Firefox profile name
    -f, --firefox=path               Firefox command path

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.