gondler 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/lib/gondler/cli.rb +23 -21
 - data/lib/gondler/package.rb +1 -1
 - data/lib/gondler/repl.rb +35 -0
 - data/lib/gondler/version.rb +1 -1
 - data/lib/gondler.rb +7 -6
 - data/spec/gondler/package_spec.rb +1 -2
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA1:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: cf6dd93e80946971588d4d6d2fc4751b9faf7cae
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: bda78e6d42392e0710635fea48fc6ae50d5604e5
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 2c79866d55195c7d14b1c8f1ba1cd5683ed971571c88a193482dade7792ca95e033398241d33c456758ebf3b8770719209486da9f721b31c19e74aaaccb7de60
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: a34d1ccea61c134b31d3147b11cc756a0bd6a2a742c8b378589015b0598709650229ac67f7991b8cea3b0a8c20c171063ec5562028b69316e0909f787203b999
         
     | 
    
        data/lib/gondler/cli.rb
    CHANGED
    
    | 
         @@ -1,5 +1,4 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            require 'thor'
         
     | 
| 
       2 
     | 
    
         
            -
            require 'readline'
         
     | 
| 
       3 
2 
     | 
    
         
             
            require 'pathname'
         
     | 
| 
       4 
3 
     | 
    
         
             
            require 'gondler'
         
     | 
| 
       5 
4 
     | 
    
         | 
| 
         @@ -15,11 +14,13 @@ module Gondler 
     | 
|
| 
       15 
14 
     | 
    
         
             
                end
         
     | 
| 
       16 
15 
     | 
    
         | 
| 
       17 
16 
     | 
    
         
             
                desc 'install', 'Install the dependecies specified in your Gomfile'
         
     | 
| 
       18 
     | 
    
         
            -
                method_option :without, :type => :array, :default =>  
     | 
| 
      
 17 
     | 
    
         
            +
                method_option :without, :type => :array, :default => nil
         
     | 
| 
       19 
18 
     | 
    
         
             
                def install
         
     | 
| 
       20 
     | 
    
         
            -
                   
     | 
| 
       21 
     | 
    
         
            -
                     
     | 
| 
       22 
     | 
    
         
            -
             
     | 
| 
      
 19 
     | 
    
         
            +
                  Gondler.without(options[:without] || []) do
         
     | 
| 
      
 20 
     | 
    
         
            +
                    gomfile.packages.each do |package|
         
     | 
| 
      
 21 
     | 
    
         
            +
                      puts "Install #{package}"
         
     | 
| 
      
 22 
     | 
    
         
            +
                      package.resolve
         
     | 
| 
      
 23 
     | 
    
         
            +
                    end
         
     | 
| 
       23 
24 
     | 
    
         
             
                  end
         
     | 
| 
       24 
25 
     | 
    
         
             
                rescue Gondler::Package::InstallError => e
         
     | 
| 
       25 
26 
     | 
    
         
             
                  puts e.message
         
     | 
| 
         @@ -28,12 +29,17 @@ module Gondler 
     | 
|
| 
       28 
29 
     | 
    
         | 
| 
       29 
30 
     | 
    
         
             
                desc 'build', 'Build with dependencies specified in your Gomfile'
         
     | 
| 
       30 
31 
     | 
    
         
             
                def build(*args)
         
     | 
| 
       31 
     | 
    
         
            -
                  invoke : 
     | 
| 
      
 32 
     | 
    
         
            +
                  invoke :go, %w(build) + args
         
     | 
| 
       32 
33 
     | 
    
         
             
                end
         
     | 
| 
       33 
34 
     | 
    
         | 
| 
       34 
35 
     | 
    
         
             
                desc 'test', 'Test with dependencies specified in your Gomfile'
         
     | 
| 
       35 
36 
     | 
    
         
             
                def test(*args)
         
     | 
| 
       36 
     | 
    
         
            -
                  invoke : 
     | 
| 
      
 37 
     | 
    
         
            +
                  invoke :go, %w(test) + args
         
     | 
| 
      
 38 
     | 
    
         
            +
                end
         
     | 
| 
      
 39 
     | 
    
         
            +
             
     | 
| 
      
 40 
     | 
    
         
            +
                desc 'go', 'Execute go command in the context of Gondler'
         
     | 
| 
      
 41 
     | 
    
         
            +
                def go(*args)
         
     | 
| 
      
 42 
     | 
    
         
            +
                  invoke :exec, %w(go) + args
         
     | 
| 
       37 
43 
     | 
    
         
             
                end
         
     | 
| 
       38 
44 
     | 
    
         | 
| 
       39 
45 
     | 
    
         
             
                desc 'exec', 'Execute a command in the context of Gondler'
         
     | 
| 
         @@ -49,24 +55,20 @@ module Gondler 
     | 
|
| 
       49 
55 
     | 
    
         
             
                end
         
     | 
| 
       50 
56 
     | 
    
         | 
| 
       51 
57 
     | 
    
         
             
                desc 'list', 'Show all of the dependencies in the current bundle'
         
     | 
| 
       52 
     | 
    
         
            -
                method_option :without, :type => :array, :default =>  
     | 
| 
      
 58 
     | 
    
         
            +
                method_option :without, :type => :array, :default => nil
         
     | 
| 
       53 
59 
     | 
    
         
             
                def list
         
     | 
| 
       54 
     | 
    
         
            -
                  Gondler. 
     | 
| 
       55 
     | 
    
         
            -
             
     | 
| 
       56 
     | 
    
         
            -
             
     | 
| 
       57 
     | 
    
         
            -
             
     | 
| 
       58 
     | 
    
         
            -
                     
     | 
| 
      
 60 
     | 
    
         
            +
                  Gondler.without(options[:without] || []) do
         
     | 
| 
      
 61 
     | 
    
         
            +
                    puts 'Packages included by the gondler:'
         
     | 
| 
      
 62 
     | 
    
         
            +
                    gomfile.packages.each do |package|
         
     | 
| 
      
 63 
     | 
    
         
            +
                      puts " * #{package}"
         
     | 
| 
      
 64 
     | 
    
         
            +
                    end
         
     | 
| 
       59 
65 
     | 
    
         
             
                  end
         
     | 
| 
       60 
66 
     | 
    
         
             
                end
         
     | 
| 
       61 
67 
     | 
    
         | 
| 
       62 
68 
     | 
    
         
             
                desc 'repl', 'REPL in the context of Gondler'
         
     | 
| 
       63 
69 
     | 
    
         
             
                def repl
         
     | 
| 
       64 
     | 
    
         
            -
                   
     | 
| 
       65 
     | 
    
         
            -
                   
     | 
| 
       66 
     | 
    
         
            -
                    Kernel.system(buf)
         
     | 
| 
       67 
     | 
    
         
            -
             
     | 
| 
       68 
     | 
    
         
            -
                    buf = Readline.readline('> ', true)
         
     | 
| 
       69 
     | 
    
         
            -
                  end
         
     | 
| 
      
 70 
     | 
    
         
            +
                  require 'gondler/repl'
         
     | 
| 
      
 71 
     | 
    
         
            +
                  Gondler::REPL.run
         
     | 
| 
       70 
72 
     | 
    
         
             
                end
         
     | 
| 
       71 
73 
     | 
    
         | 
| 
       72 
74 
     | 
    
         
             
                desc 'version', 'Print Gondler version'
         
     | 
| 
         @@ -75,8 +77,8 @@ module Gondler 
     | 
|
| 
       75 
77 
     | 
    
         
             
                end
         
     | 
| 
       76 
78 
     | 
    
         | 
| 
       77 
79 
     | 
    
         
             
                desc 'env', 'Print Gondler environments'
         
     | 
| 
       78 
     | 
    
         
            -
                def env
         
     | 
| 
       79 
     | 
    
         
            -
                   
     | 
| 
      
 80 
     | 
    
         
            +
                def env(*args)
         
     | 
| 
      
 81 
     | 
    
         
            +
                  invoke :go, %w(env) + args
         
     | 
| 
       80 
82 
     | 
    
         
             
                end
         
     | 
| 
       81 
83 
     | 
    
         | 
| 
       82 
84 
     | 
    
         
             
                private
         
     | 
    
        data/lib/gondler/package.rb
    CHANGED
    
    
    
        data/lib/gondler/repl.rb
    ADDED
    
    | 
         @@ -0,0 +1,35 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            require 'readline'
         
     | 
| 
      
 2 
     | 
    
         
            +
            require 'gondler'
         
     | 
| 
      
 3 
     | 
    
         
            +
             
     | 
| 
      
 4 
     | 
    
         
            +
            class Gondler::REPL
         
     | 
| 
      
 5 
     | 
    
         
            +
              def self.run
         
     | 
| 
      
 6 
     | 
    
         
            +
                new.run
         
     | 
| 
      
 7 
     | 
    
         
            +
              end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
              def initialize
         
     | 
| 
      
 10 
     | 
    
         
            +
              end
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
              def run
         
     | 
| 
      
 13 
     | 
    
         
            +
                while (buf = Readline.readline("> ", true))
         
     | 
| 
      
 14 
     | 
    
         
            +
                  execute(buf)
         
     | 
| 
      
 15 
     | 
    
         
            +
                end
         
     | 
| 
      
 16 
     | 
    
         
            +
              end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
              def execute(line)
         
     | 
| 
      
 19 
     | 
    
         
            +
                cmd = line.match(/\A\w+/).to_s
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                if builtin.include?(cmd)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  Gondler::CLI.start(line.split(/\s+/))
         
     | 
| 
      
 23 
     | 
    
         
            +
                else
         
     | 
| 
      
 24 
     | 
    
         
            +
                  system(line)
         
     | 
| 
      
 25 
     | 
    
         
            +
                end
         
     | 
| 
      
 26 
     | 
    
         
            +
              end
         
     | 
| 
      
 27 
     | 
    
         
            +
             
     | 
| 
      
 28 
     | 
    
         
            +
              def builtin
         
     | 
| 
      
 29 
     | 
    
         
            +
                @builtin ||= builtin_commands.keys + ['help']
         
     | 
| 
      
 30 
     | 
    
         
            +
              end
         
     | 
| 
      
 31 
     | 
    
         
            +
             
     | 
| 
      
 32 
     | 
    
         
            +
              def builtin_commands
         
     | 
| 
      
 33 
     | 
    
         
            +
                @builtin_commands ||= Gondler::CLI.commands
         
     | 
| 
      
 34 
     | 
    
         
            +
              end
         
     | 
| 
      
 35 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/gondler/version.rb
    CHANGED
    
    
    
        data/lib/gondler.rb
    CHANGED
    
    | 
         @@ -6,12 +6,13 @@ require 'gondler/gomfile' 
     | 
|
| 
       6 
6 
     | 
    
         | 
| 
       7 
7 
     | 
    
         
             
            module Gondler
         
     | 
| 
       8 
8 
     | 
    
         
             
              class << self
         
     | 
| 
       9 
     | 
    
         
            -
                def  
     | 
| 
       10 
     | 
    
         
            -
                   
     | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
             
     | 
| 
       14 
     | 
    
         
            -
                   
     | 
| 
      
 9 
     | 
    
         
            +
                def without(_without = nil)
         
     | 
| 
      
 10 
     | 
    
         
            +
                  if block_given?
         
     | 
| 
      
 11 
     | 
    
         
            +
                    _without, @without = without, _without
         
     | 
| 
      
 12 
     | 
    
         
            +
                    yield
         
     | 
| 
      
 13 
     | 
    
         
            +
                    @without = _without
         
     | 
| 
      
 14 
     | 
    
         
            +
                  end
         
     | 
| 
      
 15 
     | 
    
         
            +
                  @without || []
         
     | 
| 
       15 
16 
     | 
    
         
             
                end
         
     | 
| 
       16 
17 
     | 
    
         | 
| 
       17 
18 
     | 
    
         
             
                def env
         
     | 
| 
         @@ -51,8 +51,7 @@ describe Gondler::Package do 
     | 
|
| 
       51 
51 
     | 
    
         
             
                end
         
     | 
| 
       52 
52 
     | 
    
         | 
| 
       53 
53 
     | 
    
         
             
                context 'when development without' do
         
     | 
| 
       54 
     | 
    
         
            -
                   
     | 
| 
       55 
     | 
    
         
            -
                  after { Gondler.withouts = [] }
         
     | 
| 
      
 54 
     | 
    
         
            +
                  around {|e| Gondler.without(%w(development)) { e.run } }
         
     | 
| 
       56 
55 
     | 
    
         | 
| 
       57 
56 
     | 
    
         
             
                  let(:options) { { :group => 'development' } }
         
     | 
| 
       58 
57 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: gondler
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.2
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Sho Kusano
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2013-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2013-10-14 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rake
         
     | 
| 
         @@ -61,6 +61,7 @@ files: 
     | 
|
| 
       61 
61 
     | 
    
         
             
            - lib/gondler/env.rb
         
     | 
| 
       62 
62 
     | 
    
         
             
            - lib/gondler/gomfile.rb
         
     | 
| 
       63 
63 
     | 
    
         
             
            - lib/gondler/package.rb
         
     | 
| 
      
 64 
     | 
    
         
            +
            - lib/gondler/repl.rb
         
     | 
| 
       64 
65 
     | 
    
         
             
            - lib/gondler/version.rb
         
     | 
| 
       65 
66 
     | 
    
         
             
            - spec/gondler/env_spec.rb
         
     | 
| 
       66 
67 
     | 
    
         
             
            - spec/gondler/gomfile_spec.rb
         
     |