homesteading 0.0.10 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a7b41452816dfe2adc16b5b5a9012c893cddf727
4
- data.tar.gz: 6f2ec73e6400a7631182065332452e481ec1fed6
3
+ metadata.gz: 6792e28645cb8229d923ba0aaa1f9e04170a9af3
4
+ data.tar.gz: c2cf6594cf27534151605d61405a564cc4200615
5
5
  SHA512:
6
- metadata.gz: 5a44622c54546d853aea146d8c8517bc8394bfe6f1523c7460d1b5b79f06125f1de78114bc1b8776e79078e0487e02470ca226d7440a0cd5c1d4f0127d074182
7
- data.tar.gz: f9fbbe01bec04f7fd9da05a6a02d762767d1b32ce618c5d5d3ffc8d6c873305cbcef1100db2f15df183d6866bb56ce0f638cba6a8b8c811927b1b5371fccb756
6
+ metadata.gz: 552649b99c1c0e00d64d9b7b6a99f86f88b546b710100868b30bf33ae6f73d7212eae894d980a0c5ce4f2ea9c2ffe56db921cd1a9c1f6996ac1fcfcc3f2a7b4a
7
+ data.tar.gz: 85c881e994998935b74379cb33d484194e7c6b95ae947ec675184f0919088add3cba56e74ee52046936463c0f8d78034ee7a68c3057f3a4d619b53036e9b9cdd
data/README.md CHANGED
@@ -12,7 +12,7 @@ See the [/help](https://github.com/homesteading/homesteading/tree/master/help) d
12
12
 
13
13
  ## Current Version
14
14
 
15
- 0.0.10
15
+ 0.1.0
16
16
 
17
17
 
18
18
  ## Requirements
@@ -32,12 +32,15 @@ gem install homesteading
32
32
 
33
33
  ## Usage
34
34
 
35
- **TODO**
36
-
37
- Currently, only one command:
35
+ To get started:
38
36
 
39
37
  ```bash
40
- homesteading
38
+ homesteading new path/to/install/location
39
+ cd path/to/install/location
40
+ homesteading run rake hs:db:config
41
+ homesteading run rake db:migrate
42
+ homesteading run rake db:seed
43
+ homesteading server
41
44
  ```
42
45
 
43
46
  You can alias `homesteading` to `hs` for shorter commands.
@@ -71,7 +74,7 @@ If you find bugs, have feature requests or questions, please
71
74
  Your heart is as free as the air you breathe. <br>
72
75
  The ground you stand on is liberated territory.
73
76
 
74
- In legal text, Homesteading is dedicated to the public domain
77
+ In legal text, The Homesteading CLI is dedicated to the public domain
75
78
  using Creative Commons -- CC0 1.0 Universal.
76
79
 
77
80
  [http://creativecommons.org/publicdomain/zero/1.0](http://creativecommons.org/publicdomain/zero/1.0 "Creative Commons &mdash; CC0 1.0 Universal")
data/bin/homesteading CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require "homesteading/commands/help"
3
2
  require "optparse"
4
3
  require "fileutils"
5
4
  require "json"
6
5
  require "yaml"
6
+ require "homesteading/commands/help"
7
7
 
8
8
  if ARGV.empty?
9
9
  name_space = "Help"
data/help/init.md ADDED
@@ -0,0 +1,32 @@
1
+ Usage: homesteading init
2
+
3
+ run initial setup on homesteading apps
4
+ (run automatically as a part 'homesteading new')
5
+
6
+ Example:
7
+
8
+ $ homesteading init
9
+
10
+ * Setting up all apps
11
+
12
+ * Setting up: article
13
+ * Copying database config file
14
+ cp config/database.example.yml config/database.yml
15
+ * Running postdeploy command on article:
16
+ [...]
17
+ * Setup up complete for: article
18
+
19
+ * Setting up: note
20
+ * Copying database config file
21
+ cp config/database.example.yml config/database.yml
22
+ * Running postdeploy command on note:
23
+ [...]
24
+ * Setup up complete for: note
25
+
26
+ * Setting up: photo
27
+ * Copying database config file
28
+ cp config/database.example.yml config/database.yml
29
+ * Running postdeploy command on photo:
30
+ [...]
31
+ * Setup up complete for: photo
32
+
data/help/new.md CHANGED
@@ -27,6 +27,18 @@ Example:
27
27
  * Cloning homesteading app from GitHub: walk
28
28
  * Cloning homesteading app from GitHub: weight
29
29
 
30
+ * Setting up: hub
31
+ * Setting up: router-rack
32
+ * Setting up: article
33
+ * Setting up: bookmark
34
+ * Setting up: event
35
+ * Setting up: note
36
+ * Setting up: photo
37
+ * Setting up: sound
38
+ * Setting up: video
39
+ * Setting up: walk
40
+ * Setting up: weight
41
+
30
42
  * Next up, do this:
31
43
  cd my-site
32
44
  homesteading server
data/help/run.md CHANGED
@@ -1,3 +1,29 @@
1
- # TODO:
2
-
3
1
  Usage: homesteading run
2
+
3
+ run a command on your installed homesteading apps
4
+
5
+ Example:
6
+
7
+ $ homesteading run rake db:migrate --app note
8
+
9
+ * Running command on note:
10
+ rake db:migrate
11
+
12
+ == 20131005070716 CreatePosts: migrating ======================================
13
+ -- create_table(:posts)
14
+ -> 0.0014s
15
+ == 20131005070716 CreatePosts: migrated (0.0015s) =============================
16
+
17
+ Example:
18
+
19
+ $ homesteading run rake db:migrate
20
+
21
+ * Running command on article:
22
+ rake db:migrate
23
+ [...]
24
+ * Running command on note:
25
+ rake db:migrate
26
+ [...]
27
+ * Running command on photo:
28
+ rake db:migrate
29
+ [...]
data/help/server-stop.md CHANGED
@@ -1,19 +1,11 @@
1
- # TODO:
2
-
3
1
  Usage: homesteading server:stop
4
2
 
5
3
  stop all running homesteading apps
4
+ (TEMP over aggressively by doing a `killall ruby`)
6
5
 
7
6
  Example:
8
7
 
9
8
  $ homesteading server:stop
10
- Stopping article...
11
- ...done
12
- Stopping bookmark...
13
- ...done
14
- Stopping note...
15
- ...done
16
- Stopping hub...
17
- ...done
18
- Stopping router...
19
- ...done
9
+ Exiting
10
+ sh: line 1: 3122 Terminated: 15 rackup -p 3000
11
+ sh: line 1: 3109 Terminated: 15 rails server -p 3004
data/help/server.md CHANGED
@@ -1,4 +1,5 @@
1
1
  Usage: homesteading server
2
+ homesteading s
2
3
 
3
4
  start a server for constellation of homesteading apps
4
5
 
@@ -7,7 +8,7 @@ Usage: homesteading server
7
8
  Example:
8
9
 
9
10
  $ homesteading server
10
- * Homesteading: 0.0.10, codename: Rooftop
11
+ * Homesteading: 0.1.0, codename: Rooftop
11
12
  * Puma: 2.10.2 (ruby 2.1.5-p273), codename: Robots on Comets
12
13
  * Ruby: 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]
13
14
  * Environment: development
@@ -33,6 +34,4 @@ Example:
33
34
 
34
35
  Additional commands, type "homesteading help COMMAND" for more details:
35
36
 
36
- * server:list # list the currently running homesteading apps
37
37
  * server:stop [--app APP] # stop running homesteading apps
38
- * server:urls [--app APP] # list the urls of running homesteading apps
@@ -0,0 +1,13 @@
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
@@ -0,0 +1,44 @@
1
+ class Homesteading
2
+ class Init
3
+ class << self
4
+
5
+ def default(constellation_dir)
6
+ puts
7
+ puts "* Setting up all apps"
8
+ puts
9
+
10
+ Dir.glob("#{Dir.pwd}/#{constellation_dir}/homesteading-*/").each do |app_dir|
11
+ app = app_dir.split("/").last.sub(/homesteading-/, "").downcase
12
+ app_file_path = app_dir + "app.json"
13
+
14
+ puts "* Setting up: #{app}"
15
+
16
+ if File.exist?(app_file_path)
17
+ app_file = JSON.parse(File.read(app_file_path))
18
+ app_postdeploy = app_file["scripts"]["postdeploy"]
19
+
20
+ FileUtils.cd app_dir do
21
+ if File.exist?("#{app_dir}/config/database.example.yml")
22
+ puts "* Copying database config file"
23
+ system "rake hs:db:config"
24
+ end
25
+
26
+ unless app_postdeploy.nil? && app_postdeploy.empty?
27
+ puts "* Running postdeploy command on #{app}:"
28
+ puts
29
+ system app_postdeploy if app_postdeploy
30
+ end
31
+
32
+ puts
33
+ end
34
+ end
35
+
36
+ puts "* Setup up complete for: #{app}"
37
+ puts
38
+ puts
39
+ end
40
+ end
41
+
42
+ end
43
+ end
44
+ end
@@ -1,8 +1,10 @@
1
+ require "homesteading/commands/init"
2
+
1
3
  class Homesteading
2
4
  class New
3
5
  class << self
4
6
  PUBLISHER_APPS = ["article", "bookmark", "event", "note", "photo", "sound", "video", "walk", "weight"]
5
- NONPUBLISHER_APPS = ["hub", "router-rack"] # TODO "syndicator"
7
+ NONPUBLISHER_APPS = ["router-rack"] # TODO "hub", "syndicator"
6
8
 
7
9
  def default
8
10
  puts
@@ -90,8 +92,10 @@ class Homesteading
90
92
  end
91
93
  end
92
94
 
95
+ puts
96
+ Homesteading::Init.default(constellation_dir)
97
+
93
98
  unless options[:quiet]
94
- puts
95
99
  puts "* Next up, do this:"
96
100
  puts " cd #{constellation_dir}"
97
101
  puts " homesteading server"
@@ -3,6 +3,44 @@ class Homesteading
3
3
  class << self
4
4
 
5
5
  def default
6
+ puts
7
+ options = parse_options
8
+ app = options[:app]
9
+ command = ARGV.join(" ")
10
+
11
+ app_dirs = if app
12
+ ["#{Dir.pwd}/homesteading-#{app}/"]
13
+ else
14
+ Dir.glob("#{Dir.pwd}/homesteading-*/")
15
+ end
16
+
17
+ app_dirs.each do |app_dir|
18
+ app = app_dir.split("/").last.sub(/homesteading-/, "").downcase
19
+
20
+ puts "* Running command on #{app}:"
21
+ puts " #{command}"
22
+ puts
23
+
24
+ FileUtils.cd app_dir do
25
+ system command
26
+ end
27
+ puts
28
+ end
29
+ end
30
+
31
+ private
32
+ def parse_options
33
+ # Parse command line options
34
+ options = {}
35
+
36
+ optparse = OptionParser.new do |opts|
37
+ opts.on("-a", "--app APP", "Name of Homesteading app on GitHub") do |app|
38
+ options[:app] = app
39
+ end
40
+ end
41
+
42
+ optparse.parse!
43
+ options
6
44
  end
7
45
 
8
46
  end
@@ -1,3 +1,5 @@
1
+ require "homesteading/commands/server"
2
+
1
3
  class Homesteading
2
4
  class S
3
5
  class << self
@@ -6,6 +8,10 @@ class Homesteading
6
8
  Homesteading::Server.default
7
9
  end
8
10
 
11
+ def stop
12
+ Homesteading::Server.stop
13
+ end
14
+
9
15
  end
10
16
  end
11
17
  end
@@ -16,12 +16,12 @@ class Homesteading
16
16
  Process.kill "SIGINT", io.pid
17
17
  end
18
18
 
19
- system("homesteading server:stop")
19
+ system "homesteading server:stop"
20
20
  exit
21
21
  end
22
22
 
23
23
  # TODO
24
- homesteading_info = "0.0.10, codename: Rooftop"
24
+ homesteading_info = "0.1.0, codename: Rooftop"
25
25
  ruby_info = RUBY_VERSION
26
26
  puma_info = "2.10.2 (ruby 2.1.5-p273), codename: Robots on Comets"
27
27
  env_info = "development"
@@ -75,11 +75,10 @@ class Homesteading
75
75
  end
76
76
  end
77
77
 
78
- # TODO write routes to an env var for hs:router's routes table
78
+ # write routes to an env var for hs:router's routes table
79
79
  ENV["HOMESTEADING_ROUTES"] = routes.join(",")
80
80
 
81
81
  # start up router after ENV var is set
82
- # elsif app_name == "homesteading-router-rack"
83
82
  puts
84
83
  puts "* Starting on port #{router_port} : router"
85
84
  servers << IO.popen("cd #{Dir.pwd}/homesteading-router-rack/ && rackup -p #{router_port}", "w")
@@ -92,18 +91,12 @@ class Homesteading
92
91
  puts
93
92
  end
94
93
 
95
- def list
96
- end
97
-
98
94
  def stop
99
95
  # TEMP HACK TODO FIXME
100
96
  # This is overly aggressive, but Signal.trap isn't working
101
97
  system "killall ruby"
102
98
  end
103
99
 
104
- def urls
105
- end
106
-
107
100
  private
108
101
  def parse_options
109
102
  # Parse command line options
@@ -21,7 +21,7 @@ class Homesteading
21
21
  end
22
22
  end
23
23
 
24
- puts "* All Homesteading apps are now update to the latest version"
24
+ puts "* All Homesteading apps are now updated to the latest version"
25
25
  puts
26
26
  end
27
27
 
@@ -5,7 +5,7 @@ class Homesteading
5
5
  def default
6
6
  # TODO load in *actual* VERSION and CODENAME from homesteading/version
7
7
  # puts "Homesteading #{Homesteading::VERSION}, codename: #{Homesteading::CODENAME}"
8
- puts "Homesteading 0.0.10, codename: Rooftop"
8
+ puts "Homesteading 0.1.0, codename: Rooftop"
9
9
  end
10
10
 
11
11
  end
@@ -1,4 +1,4 @@
1
1
  module Homesteading
2
- VERSION = "0.0.10"
2
+ VERSION = "0.1.0"
3
3
  CODENAME = "Rooftop"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: homesteading
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Becker
@@ -65,11 +65,10 @@ files:
65
65
  - help/deploy-heroku.md
66
66
  - help/deploy-vektra.md
67
67
  - help/deploy.md
68
+ - help/init.md
68
69
  - help/new.md
69
70
  - help/run.md
70
- - help/server-list.md
71
71
  - help/server-stop.md
72
- - help/server-urls.md
73
72
  - help/server.md
74
73
  - help/update-client.md
75
74
  - help/update.md
@@ -77,7 +76,9 @@ files:
77
76
  - homesteading.gemspec
78
77
  - lib/homesteading.rb
79
78
  - lib/homesteading/commands/apps.rb
79
+ - lib/homesteading/commands/h.rb
80
80
  - lib/homesteading/commands/help.rb
81
+ - lib/homesteading/commands/init.rb
81
82
  - lib/homesteading/commands/new.rb
82
83
  - lib/homesteading/commands/run.rb
83
84
  - lib/homesteading/commands/s.rb
data/help/server-list.md DELETED
@@ -1,3 +0,0 @@
1
- # TODO:
2
-
3
- Usage: homesteading server:list
data/help/server-urls.md DELETED
@@ -1,3 +0,0 @@
1
- # TODO:
2
-
3
- Usage: homesteading server:urls