homesteading 0.1.0 → 0.2.0
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/README.md +0 -3
 - data/bin/homesteading +37 -20
 - data/lib/homesteading/command.rb +19 -0
 - data/lib/homesteading/commands/apps.rb +242 -242
 - data/lib/homesteading/commands/help.rb +26 -25
 - data/lib/homesteading/commands/init.rb +29 -29
 - data/lib/homesteading/commands/new.rb +100 -99
 - data/lib/homesteading/commands/run.rb +36 -35
 - data/lib/homesteading/commands/server.rb +98 -97
 - data/lib/homesteading/commands/update.rb +55 -56
 - data/lib/homesteading/commands/version.rb +7 -8
 - data/lib/homesteading/version.rb +2 -2
 - metadata +3 -4
 - data/lib/homesteading/commands/h.rb +0 -13
 - data/lib/homesteading/commands/s.rb +0 -17
 
| 
         @@ -1,84 +1,83 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
              class Update
         
     | 
| 
       3 
     | 
    
         
            -
                class << self
         
     | 
| 
      
 1 
     | 
    
         
            +
            require "homesteading/command"
         
     | 
| 
       4 
2 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
      
 3 
     | 
    
         
            +
            module Homesteading
         
     | 
| 
      
 4 
     | 
    
         
            +
              class Update < Command
         
     | 
| 
      
 5 
     | 
    
         
            +
                register "update"
         
     | 
| 
       7 
6 
     | 
    
         | 
| 
       8 
     | 
    
         
            -
             
     | 
| 
       9 
     | 
    
         
            -
             
     | 
| 
      
 7 
     | 
    
         
            +
                def default
         
     | 
| 
      
 8 
     | 
    
         
            +
                  puts
         
     | 
| 
       10 
9 
     | 
    
         | 
| 
       11 
     | 
    
         
            -
             
     | 
| 
       12 
     | 
    
         
            -
             
     | 
| 
       13 
     | 
    
         
            -
                        puts "* Updating #{dir.split("/").last}..."
         
     | 
| 
      
 10 
     | 
    
         
            +
                  options = parse_options
         
     | 
| 
      
 11 
     | 
    
         
            +
                  hs_path = options[:hs_path] || Dir.pwd
         
     | 
| 
       14 
12 
     | 
    
         | 
| 
       15 
     | 
    
         
            -
             
     | 
| 
       16 
     | 
    
         
            -
             
     | 
| 
       17 
     | 
    
         
            -
             
     | 
| 
      
 13 
     | 
    
         
            +
                  Dir.glob("#{hs_path}/*").each do |dir|
         
     | 
| 
      
 14 
     | 
    
         
            +
                    unless Dir.glob("#{dir}/.git/config").empty?
         
     | 
| 
      
 15 
     | 
    
         
            +
                      puts "* Updating #{dir.split("/").last}..."
         
     | 
| 
       18 
16 
     | 
    
         | 
| 
       19 
     | 
    
         
            -
             
     | 
| 
       20 
     | 
    
         
            -
                         
     | 
| 
      
 17 
     | 
    
         
            +
                      FileUtils.cd dir do
         
     | 
| 
      
 18 
     | 
    
         
            +
                        system "git pull origin master"
         
     | 
| 
       21 
19 
     | 
    
         
             
                      end
         
     | 
| 
       22 
     | 
    
         
            -
                    end
         
     | 
| 
       23 
20 
     | 
    
         | 
| 
       24 
     | 
    
         
            -
             
     | 
| 
       25 
     | 
    
         
            -
             
     | 
| 
      
 21 
     | 
    
         
            +
                      puts "* ...done"
         
     | 
| 
      
 22 
     | 
    
         
            +
                      puts
         
     | 
| 
      
 23 
     | 
    
         
            +
                    end
         
     | 
| 
       26 
24 
     | 
    
         
             
                  end
         
     | 
| 
       27 
25 
     | 
    
         | 
| 
       28 
     | 
    
         
            -
                   
     | 
| 
       29 
     | 
    
         
            -
             
     | 
| 
      
 26 
     | 
    
         
            +
                  puts "* All Homesteading apps are now updated to the latest version"
         
     | 
| 
      
 27 
     | 
    
         
            +
                  puts
         
     | 
| 
      
 28 
     | 
    
         
            +
                end
         
     | 
| 
       30 
29 
     | 
    
         | 
| 
       31 
     | 
    
         
            -
             
     | 
| 
      
 30 
     | 
    
         
            +
                def client
         
     | 
| 
      
 31 
     | 
    
         
            +
                  puts
         
     | 
| 
       32 
32 
     | 
    
         | 
| 
       33 
     | 
    
         
            -
             
     | 
| 
       34 
     | 
    
         
            -
                      puts "* Cloning Homesteading from GitHub into /tmp"
         
     | 
| 
       35 
     | 
    
         
            -
                      FileUtils.cd "/tmp" do
         
     | 
| 
       36 
     | 
    
         
            -
                        system "git clone git@github.com:homesteading/homesteading.git"
         
     | 
| 
       37 
     | 
    
         
            -
                      end
         
     | 
| 
      
 33 
     | 
    
         
            +
                  options = parse_options
         
     | 
| 
       38 
34 
     | 
    
         | 
| 
       39 
     | 
    
         
            -
             
     | 
| 
       40 
     | 
    
         
            -
             
     | 
| 
       41 
     | 
    
         
            -
             
     | 
| 
       42 
     | 
    
         
            -
                       
     | 
| 
      
 35 
     | 
    
         
            +
                  if options[:beta]
         
     | 
| 
      
 36 
     | 
    
         
            +
                    puts "* Cloning Homesteading from GitHub into /tmp"
         
     | 
| 
      
 37 
     | 
    
         
            +
                    FileUtils.cd "/tmp" do
         
     | 
| 
      
 38 
     | 
    
         
            +
                      system "git clone git@github.com:homesteading/homesteading.git"
         
     | 
| 
      
 39 
     | 
    
         
            +
                    end
         
     | 
| 
       43 
40 
     | 
    
         | 
| 
       44 
     | 
    
         
            -
             
     | 
| 
       45 
     | 
    
         
            -
             
     | 
| 
      
 41 
     | 
    
         
            +
                    puts "* Building homesteading gem from .gemspec"
         
     | 
| 
      
 42 
     | 
    
         
            +
                    FileUtils.cd "/tmp/homesteading" do
         
     | 
| 
      
 43 
     | 
    
         
            +
                      system "gem build homesteading.gemspec"
         
     | 
| 
      
 44 
     | 
    
         
            +
                    end
         
     | 
| 
       46 
45 
     | 
    
         | 
| 
       47 
     | 
    
         
            -
             
     | 
| 
       48 
     | 
    
         
            -
             
     | 
| 
      
 46 
     | 
    
         
            +
                    dot_gem = Dir.glob("/tmp/homesteading/*.gem").last
         
     | 
| 
      
 47 
     | 
    
         
            +
                    version = dot_gem.split("/").last.sub("homesteading-", "").sub(".gem", "")
         
     | 
| 
       49 
48 
     | 
    
         | 
| 
       50 
     | 
    
         
            -
             
     | 
| 
       51 
     | 
    
         
            -
             
     | 
| 
      
 49 
     | 
    
         
            +
                    puts "* Installing homesteading version #{version}"
         
     | 
| 
      
 50 
     | 
    
         
            +
                    system "gem install #{dot_gem}"
         
     | 
| 
       52 
51 
     | 
    
         | 
| 
       53 
     | 
    
         
            -
             
     | 
| 
       54 
     | 
    
         
            -
                     
     | 
| 
       55 
     | 
    
         
            -
                      system "gem install homesteading"
         
     | 
| 
       56 
     | 
    
         
            -
                    end
         
     | 
| 
      
 52 
     | 
    
         
            +
                    puts "* Cleaning up"
         
     | 
| 
      
 53 
     | 
    
         
            +
                    FileUtils.rm_rf "/tmp/homesteading"
         
     | 
| 
       57 
54 
     | 
    
         | 
| 
       58 
     | 
    
         
            -
                    puts
         
     | 
| 
      
 55 
     | 
    
         
            +
                    puts "* Homesteading CLI version #{version} successfully installed from GitHub"
         
     | 
| 
      
 56 
     | 
    
         
            +
                  else
         
     | 
| 
      
 57 
     | 
    
         
            +
                    system "gem install homesteading"
         
     | 
| 
       59 
58 
     | 
    
         
             
                  end
         
     | 
| 
       60 
59 
     | 
    
         | 
| 
       61 
     | 
    
         
            -
                   
     | 
| 
       62 
     | 
    
         
            -
             
     | 
| 
       63 
     | 
    
         
            -
                    # Parse command line options
         
     | 
| 
       64 
     | 
    
         
            -
                    options = {}
         
     | 
| 
       65 
     | 
    
         
            -
             
     | 
| 
       66 
     | 
    
         
            -
                    optparse = OptionParser.new do |opts|
         
     | 
| 
       67 
     | 
    
         
            -
                      opts.banner = "Learning Option parsing in Ruby"
         
     | 
| 
      
 60 
     | 
    
         
            +
                  puts
         
     | 
| 
      
 61 
     | 
    
         
            +
                end
         
     | 
| 
       68 
62 
     | 
    
         | 
| 
       69 
     | 
    
         
            -
             
     | 
| 
       70 
     | 
    
         
            -
             
     | 
| 
       71 
     | 
    
         
            -
             
     | 
| 
      
 63 
     | 
    
         
            +
                private
         
     | 
| 
      
 64 
     | 
    
         
            +
                def parse_options
         
     | 
| 
      
 65 
     | 
    
         
            +
                  # Parse command line options
         
     | 
| 
      
 66 
     | 
    
         
            +
                  options = {}
         
     | 
| 
       72 
67 
     | 
    
         | 
| 
       73 
     | 
    
         
            -
             
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
       75 
     | 
    
         
            -
                       
     | 
| 
      
 68 
     | 
    
         
            +
                  optparse = OptionParser.new do |opts|
         
     | 
| 
      
 69 
     | 
    
         
            +
                    opts.on("-p", "--path PATH", "Path of the constelation of Homesteading apps") do |opt_path|
         
     | 
| 
      
 70 
     | 
    
         
            +
                      options[:hs_path] = opt_path
         
     | 
| 
       76 
71 
     | 
    
         
             
                    end
         
     | 
| 
       77 
72 
     | 
    
         | 
| 
       78 
     | 
    
         
            -
                     
     | 
| 
       79 
     | 
    
         
            -
             
     | 
| 
      
 73 
     | 
    
         
            +
                    opts.on("-b", "--beta", "Update to the latest beta Homesteading CLI") do |beta|
         
     | 
| 
      
 74 
     | 
    
         
            +
                      options[:beta] = beta
         
     | 
| 
      
 75 
     | 
    
         
            +
                    end
         
     | 
| 
       80 
76 
     | 
    
         
             
                  end
         
     | 
| 
       81 
77 
     | 
    
         | 
| 
      
 78 
     | 
    
         
            +
                  optparse.parse!
         
     | 
| 
      
 79 
     | 
    
         
            +
                  options
         
     | 
| 
       82 
80 
     | 
    
         
             
                end
         
     | 
| 
      
 81 
     | 
    
         
            +
             
     | 
| 
       83 
82 
     | 
    
         
             
              end
         
     | 
| 
       84 
83 
     | 
    
         
             
            end
         
     | 
| 
         @@ -1,13 +1,12 @@ 
     | 
|
| 
       1 
     | 
    
         
            -
             
     | 
| 
       2 
     | 
    
         
            -
             
     | 
| 
       3 
     | 
    
         
            -
                class << self
         
     | 
| 
      
 1 
     | 
    
         
            +
            require "homesteading/command"
         
     | 
| 
      
 2 
     | 
    
         
            +
            require "homesteading/version"
         
     | 
| 
       4 
3 
     | 
    
         | 
| 
       5 
     | 
    
         
            -
             
     | 
| 
       6 
     | 
    
         
            -
             
     | 
| 
       7 
     | 
    
         
            -
             
     | 
| 
       8 
     | 
    
         
            -
                    puts "Homesteading 0.1.0, codename: Rooftop"
         
     | 
| 
       9 
     | 
    
         
            -
                  end
         
     | 
| 
      
 4 
     | 
    
         
            +
            module Homesteading
         
     | 
| 
      
 5 
     | 
    
         
            +
              class Version < Command
         
     | 
| 
      
 6 
     | 
    
         
            +
                register "version"
         
     | 
| 
       10 
7 
     | 
    
         | 
| 
      
 8 
     | 
    
         
            +
                def default
         
     | 
| 
      
 9 
     | 
    
         
            +
                  puts "Homesteading #{Homesteading::VERSION}, codename: #{Homesteading::CODENAME}"
         
     | 
| 
       11 
10 
     | 
    
         
             
                end
         
     | 
| 
       12 
11 
     | 
    
         
             
              end
         
     | 
| 
       13 
12 
     | 
    
         
             
            end
         
     | 
    
        data/lib/homesteading/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: homesteading
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.2.0
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Shane Becker
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2014-12- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2014-12-10 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     | 
| 
         @@ -75,13 +75,12 @@ files: 
     | 
|
| 
       75 
75 
     | 
    
         
             
            - help/version.md
         
     | 
| 
       76 
76 
     | 
    
         
             
            - homesteading.gemspec
         
     | 
| 
       77 
77 
     | 
    
         
             
            - lib/homesteading.rb
         
     | 
| 
      
 78 
     | 
    
         
            +
            - lib/homesteading/command.rb
         
     | 
| 
       78 
79 
     | 
    
         
             
            - lib/homesteading/commands/apps.rb
         
     | 
| 
       79 
     | 
    
         
            -
            - lib/homesteading/commands/h.rb
         
     | 
| 
       80 
80 
     | 
    
         
             
            - lib/homesteading/commands/help.rb
         
     | 
| 
       81 
81 
     | 
    
         
             
            - lib/homesteading/commands/init.rb
         
     | 
| 
       82 
82 
     | 
    
         
             
            - lib/homesteading/commands/new.rb
         
     | 
| 
       83 
83 
     | 
    
         
             
            - lib/homesteading/commands/run.rb
         
     | 
| 
       84 
     | 
    
         
            -
            - lib/homesteading/commands/s.rb
         
     | 
| 
       85 
84 
     | 
    
         
             
            - lib/homesteading/commands/server.rb
         
     | 
| 
       86 
85 
     | 
    
         
             
            - lib/homesteading/commands/update.rb
         
     | 
| 
       87 
86 
     | 
    
         
             
            - lib/homesteading/commands/version.rb
         
     |