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.
@@ -1,84 +1,83 @@
1
- class Homesteading
2
- class Update
3
- class << self
1
+ require "homesteading/command"
4
2
 
5
- def default
6
- puts
3
+ module Homesteading
4
+ class Update < Command
5
+ register "update"
7
6
 
8
- options = parse_options
9
- hs_path = options[:hs_path] || Dir.pwd
7
+ def default
8
+ puts
10
9
 
11
- Dir.glob("#{hs_path}/*").each do |dir|
12
- unless Dir.glob("#{dir}/.git/config").empty?
13
- puts "* Updating #{dir.split("/").last}..."
10
+ options = parse_options
11
+ hs_path = options[:hs_path] || Dir.pwd
14
12
 
15
- FileUtils.cd dir do
16
- system "git pull origin master"
17
- end
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
- puts "* ...done"
20
- puts
17
+ FileUtils.cd dir do
18
+ system "git pull origin master"
21
19
  end
22
- end
23
20
 
24
- puts "* All Homesteading apps are now updated to the latest version"
25
- puts
21
+ puts "* ...done"
22
+ puts
23
+ end
26
24
  end
27
25
 
28
- def client
29
- puts
26
+ puts "* All Homesteading apps are now updated to the latest version"
27
+ puts
28
+ end
30
29
 
31
- options = parse_options
30
+ def client
31
+ puts
32
32
 
33
- if options[:beta]
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
- puts "* Building homesteading gem from .gemspec"
40
- FileUtils.cd "/tmp/homesteading" do
41
- system "gem build homesteading.gemspec"
42
- end
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
- dot_gem = Dir.glob("/tmp/homesteading/*.gem").last
45
- version = dot_gem.split("/").last.sub("homesteading-", "").sub(".gem", "")
41
+ puts "* Building homesteading gem from .gemspec"
42
+ FileUtils.cd "/tmp/homesteading" do
43
+ system "gem build homesteading.gemspec"
44
+ end
46
45
 
47
- puts "* Installing homesteading version #{version}"
48
- system "gem install #{dot_gem}"
46
+ dot_gem = Dir.glob("/tmp/homesteading/*.gem").last
47
+ version = dot_gem.split("/").last.sub("homesteading-", "").sub(".gem", "")
49
48
 
50
- puts "* Cleaning up"
51
- FileUtils.rm_rf "/tmp/homesteading"
49
+ puts "* Installing homesteading version #{version}"
50
+ system "gem install #{dot_gem}"
52
51
 
53
- puts "* Homesteading CLI version #{version} successfully installed from GitHub"
54
- else
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
- private
62
- def parse_options
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
- opts.on("-p", "--path PATH", "Path of the constelation of Homesteading apps") do |opt_path|
70
- options[:hs_path] = opt_path
71
- end
63
+ private
64
+ def parse_options
65
+ # Parse command line options
66
+ options = {}
72
67
 
73
- opts.on("-b", "--beta", "Update to the latest beta Homesteading CLI") do |beta|
74
- options[:beta] = beta
75
- end
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
- optparse.parse!
79
- options
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
- class Homesteading
2
- class Version
3
- class << self
1
+ require "homesteading/command"
2
+ require "homesteading/version"
4
3
 
5
- def default
6
- # TODO load in *actual* VERSION and CODENAME from homesteading/version
7
- # puts "Homesteading #{Homesteading::VERSION}, codename: #{Homesteading::CODENAME}"
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
@@ -1,4 +1,4 @@
1
1
  module Homesteading
2
- VERSION = "0.1.0"
3
- CODENAME = "Rooftop"
2
+ VERSION = "0.2.0"
3
+ CODENAME = "The Rooftop Series"
4
4
  end
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.1.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-05 00:00:00.000000000 Z
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
@@ -1,13 +0,0 @@
1
- require "homesteading/commands/help"
2
-
3
- class Homesteading
4
- class H
5
- class << self
6
-
7
- def default
8
- Homesteading::Help.default
9
- end
10
-
11
- end
12
- end
13
- end
@@ -1,17 +0,0 @@
1
- require "homesteading/commands/server"
2
-
3
- class Homesteading
4
- class S
5
- class << self
6
-
7
- def default
8
- Homesteading::Server.default
9
- end
10
-
11
- def stop
12
- Homesteading::Server.stop
13
- end
14
-
15
- end
16
- end
17
- end