homesteading 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +68 -3
- data/Guardfile +5 -0
- data/README.md +25 -2
- data/Rakefile +4 -0
- data/help/deploy-heroku.md +27 -2
- data/help/deploy.md +21 -0
- data/homesteading.gemspec +5 -7
- data/lib/homesteading/command.rb +12 -9
- data/lib/homesteading/commands/deploy.rb +73 -0
- data/lib/homesteading/commands/server.rb +1 -5
- data/lib/homesteading/commands/version.rb +2 -0
- data/lib/homesteading/version.rb +1 -1
- data/spec/homesteading/command_spec.rb +10 -0
- data/spec/homesteading/commands/help_spec.rb +10 -0
- data/spec/homesteading_spec.rb +7 -0
- data/spec/spec_helper.rb +11 -0
- data/spec/support/test_command.rb +4 -0
- metadata +19 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a82750c6c682b84fb5bfb2166b6a0dbbc01c3da0
|
4
|
+
data.tar.gz: 78a9abdf91ea7819a1ede910f07eda5f4be57811
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf06b41d47bff573e9ec52f7dee74219ef405fcd4548686e6dc3cc45601932dfad1944c235bb4a609751ff3fe7449251cffe8ee30a18a92d58adc11e3e016294
|
7
|
+
data.tar.gz: 858c29ad2fddeec866a53e17783cd264747b9fc5c8d9b17ab0a42401fd8ca2974d2da1b7cb26bcca158a4be62fe428d36e27df185e4fdbd9171cfc224265a36c
|
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -2,3 +2,16 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in homesteading.gemspec
|
4
4
|
gemspec
|
5
|
+
|
6
|
+
group :development do
|
7
|
+
gem "bundler", "~> 1.7"
|
8
|
+
gem "rake", "~> 10.4"
|
9
|
+
gem "rspec"
|
10
|
+
gem "guard-rspec"
|
11
|
+
gem "codeclimate-test-reporter"
|
12
|
+
end
|
13
|
+
|
14
|
+
group :production do
|
15
|
+
gem "puma", "~> 2.10"
|
16
|
+
gem "git", "~> 1.2"
|
17
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,17 +1,82 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
homesteading (0.0
|
4
|
+
homesteading (0.3.0)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
-
|
9
|
+
celluloid (0.16.0)
|
10
|
+
timers (~> 4.0.0)
|
11
|
+
codeclimate-test-reporter (0.4.3)
|
12
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
13
|
+
coderay (1.1.0)
|
14
|
+
diff-lcs (1.2.5)
|
15
|
+
docile (1.1.5)
|
16
|
+
ffi (1.9.6)
|
17
|
+
formatador (0.2.5)
|
18
|
+
git (1.2.8)
|
19
|
+
guard (2.10.2)
|
20
|
+
formatador (>= 0.2.4)
|
21
|
+
listen (~> 2.7)
|
22
|
+
lumberjack (~> 1.0)
|
23
|
+
pry (>= 0.9.12)
|
24
|
+
thor (>= 0.18.1)
|
25
|
+
guard-compat (0.3.0)
|
26
|
+
guard-rspec (4.4.2)
|
27
|
+
guard (~> 2.1)
|
28
|
+
guard-compat (~> 0.1)
|
29
|
+
rspec (>= 2.99.0, < 4.0)
|
30
|
+
hitimes (1.2.2)
|
31
|
+
listen (2.8.3)
|
32
|
+
celluloid (>= 0.15.2)
|
33
|
+
rb-fsevent (>= 0.9.3)
|
34
|
+
rb-inotify (>= 0.9)
|
35
|
+
lumberjack (1.0.9)
|
36
|
+
method_source (0.8.2)
|
37
|
+
multi_json (1.10.1)
|
38
|
+
pry (0.10.1)
|
39
|
+
coderay (~> 1.1.0)
|
40
|
+
method_source (~> 0.8.1)
|
41
|
+
slop (~> 3.4)
|
42
|
+
puma (2.10.2)
|
43
|
+
rack (>= 1.1, < 2.0)
|
44
|
+
rack (1.5.2)
|
45
|
+
rake (10.4.2)
|
46
|
+
rb-fsevent (0.9.4)
|
47
|
+
rb-inotify (0.9.5)
|
48
|
+
ffi (>= 0.5.0)
|
49
|
+
rspec (3.1.0)
|
50
|
+
rspec-core (~> 3.1.0)
|
51
|
+
rspec-expectations (~> 3.1.0)
|
52
|
+
rspec-mocks (~> 3.1.0)
|
53
|
+
rspec-core (3.1.7)
|
54
|
+
rspec-support (~> 3.1.0)
|
55
|
+
rspec-expectations (3.1.2)
|
56
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
57
|
+
rspec-support (~> 3.1.0)
|
58
|
+
rspec-mocks (3.1.3)
|
59
|
+
rspec-support (~> 3.1.0)
|
60
|
+
rspec-support (3.1.2)
|
61
|
+
simplecov (0.9.1)
|
62
|
+
docile (~> 1.1.0)
|
63
|
+
multi_json (~> 1.0)
|
64
|
+
simplecov-html (~> 0.8.0)
|
65
|
+
simplecov-html (0.8.0)
|
66
|
+
slop (3.6.0)
|
67
|
+
thor (0.19.1)
|
68
|
+
timers (4.0.1)
|
69
|
+
hitimes
|
10
70
|
|
11
71
|
PLATFORMS
|
12
72
|
ruby
|
13
73
|
|
14
74
|
DEPENDENCIES
|
15
75
|
bundler (~> 1.7)
|
76
|
+
codeclimate-test-reporter
|
77
|
+
git (~> 1.2)
|
78
|
+
guard-rspec
|
16
79
|
homesteading!
|
17
|
-
|
80
|
+
puma (~> 2.10)
|
81
|
+
rake (~> 10.4)
|
82
|
+
rspec
|
data/Guardfile
ADDED
data/README.md
CHANGED
@@ -12,12 +12,20 @@ See the [/help](https://github.com/homesteading/homesteading/tree/master/help) d
|
|
12
12
|
|
13
13
|
## Current Version
|
14
14
|
|
15
|
-
0.
|
15
|
+
0.3.0
|
16
|
+
|
17
|
+
|
18
|
+
## Code Status
|
19
|
+
|
20
|
+
[![Build Status](https://api.travis-ci.org/homesteading/homesteading.png)](https://travis-ci.org/homesteading/homesteading)
|
21
|
+
[![Code Climate](https://codeclimate.com/github/homesteading/homesteading.png)](https://codeclimate.com/github/homesteading/homesteading)
|
22
|
+
[![Gem Version](https://badge.fury.io/rb/homesteading.png)](http://badge.fury.io/rb/homesteading)
|
23
|
+
[![Dependencies](https://gemnasium.com/homesteading/homesteading.png?travis)](https://gemnasium.com/homesteading/homesteading)
|
16
24
|
|
17
25
|
|
18
26
|
## Requirements
|
19
27
|
|
20
|
-
- [ruby](http://
|
28
|
+
- [ruby](http://ruby-lang.org)
|
21
29
|
- [rubygems](https://rubygems.org)
|
22
30
|
- [bundler](http://bundler.io)
|
23
31
|
- [rake](https://github.com/jimweirich/rake)
|
@@ -46,10 +54,25 @@ You can alias `homesteading` to `hs` for shorter commands.
|
|
46
54
|
alias hs="homesteading"
|
47
55
|
```
|
48
56
|
|
57
|
+
## Tests
|
58
|
+
|
59
|
+
Run specs with:
|
60
|
+
|
61
|
+
```bash
|
62
|
+
bundle exec rake
|
63
|
+
```
|
64
|
+
|
65
|
+
Or run guard to autorun specs:
|
66
|
+
|
67
|
+
```bash
|
68
|
+
bundle exec guard
|
69
|
+
```
|
49
70
|
|
50
71
|
## Authors
|
51
72
|
|
52
73
|
* Shane Becker / [@veganstraightedge](https:github.com/veganstraightedge)
|
74
|
+
* Evan Phoenix / [@evanphx](https:github.com/evanphx)
|
75
|
+
* Bookis Smuin / [@bookis](https:github.com/bookis)
|
53
76
|
|
54
77
|
|
55
78
|
## Contributions
|
data/Rakefile
CHANGED
data/help/deploy-heroku.md
CHANGED
@@ -1,3 +1,28 @@
|
|
1
|
-
# TODO:
|
2
|
-
|
3
1
|
Usage: homesteading deploy:heroku
|
2
|
+
|
3
|
+
deploy your constellation of homesteading apps to heroku
|
4
|
+
|
5
|
+
Example:
|
6
|
+
|
7
|
+
$ homesteading deploy
|
8
|
+
|
9
|
+
* Deploying article...
|
10
|
+
* ...done
|
11
|
+
* Deploying bookmark...
|
12
|
+
* ...done
|
13
|
+
* Deploying event...
|
14
|
+
* ...done
|
15
|
+
* Deploying feed...
|
16
|
+
* ...done
|
17
|
+
* Deploying note...
|
18
|
+
* ...done
|
19
|
+
* Deploying photo...
|
20
|
+
* ...done
|
21
|
+
* Deploying sound...
|
22
|
+
* ...done
|
23
|
+
* Deploying video...
|
24
|
+
* ...done
|
25
|
+
* Deploying walk...
|
26
|
+
* ...done
|
27
|
+
* Deploying weight...
|
28
|
+
* ...done
|
data/help/deploy.md
CHANGED
@@ -5,6 +5,27 @@ Usage: homesteading deploy
|
|
5
5
|
Example:
|
6
6
|
|
7
7
|
$ homesteading deploy
|
8
|
+
|
9
|
+
* Deploying article...
|
10
|
+
* ...done
|
11
|
+
* Deploying bookmark...
|
12
|
+
* ...done
|
13
|
+
* Deploying event...
|
14
|
+
* ...done
|
15
|
+
* Deploying feed...
|
16
|
+
* ...done
|
17
|
+
* Deploying note...
|
18
|
+
* ...done
|
19
|
+
* Deploying photo...
|
20
|
+
* ...done
|
21
|
+
* Deploying sound...
|
22
|
+
* ...done
|
23
|
+
* Deploying video...
|
24
|
+
* ...done
|
25
|
+
* Deploying walk...
|
26
|
+
* ...done
|
27
|
+
* Deploying weight...
|
28
|
+
* ...done
|
8
29
|
|
9
30
|
|
10
31
|
Additional commands, type "homesteading help COMMAND" for more details:
|
data/homesteading.gemspec
CHANGED
@@ -13,11 +13,9 @@ Gem::Specification.new do |spec|
|
|
13
13
|
spec.homepage = "http://homesteading.io"
|
14
14
|
spec.license = "Public Domain, CC0"
|
15
15
|
|
16
|
-
spec.files
|
17
|
-
spec.executables
|
18
|
-
spec.test_files
|
19
|
-
spec.require_paths
|
20
|
-
|
21
|
-
spec.add_development_dependency "bundler", "~> 1.7"
|
22
|
-
spec.add_development_dependency "rake", "~> 10.4"
|
16
|
+
spec.files = `git ls-files -z`.split("\x0")
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
spec.required_ruby_version = "~> 2.0"
|
23
21
|
end
|
data/lib/homesteading/command.rb
CHANGED
@@ -1,19 +1,22 @@
|
|
1
1
|
module Homesteading
|
2
2
|
class Command
|
3
|
-
|
3
|
+
class << self
|
4
|
+
COMMANDS = {}
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
def register(name, *aliases)
|
7
|
+
COMMANDS[name] = self
|
7
8
|
|
8
|
-
|
9
|
-
|
9
|
+
aliases.each do |a|
|
10
|
+
COMMANDS[a] = self
|
11
|
+
end
|
10
12
|
end
|
11
|
-
end
|
12
13
|
|
13
|
-
|
14
|
-
|
15
|
-
|
14
|
+
def create(name)
|
15
|
+
if klass = COMMANDS[name]
|
16
|
+
klass.new
|
17
|
+
end
|
16
18
|
end
|
19
|
+
|
17
20
|
end
|
18
21
|
end
|
19
22
|
end
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require "homesteading/command"
|
2
|
+
require "git"
|
3
|
+
require "logger"
|
4
|
+
|
5
|
+
module Homesteading
|
6
|
+
class Deploy < Command
|
7
|
+
register "deploy"
|
8
|
+
|
9
|
+
def default
|
10
|
+
heroku
|
11
|
+
end
|
12
|
+
|
13
|
+
def heroku
|
14
|
+
puts
|
15
|
+
options = parse_options
|
16
|
+
|
17
|
+
constellation_path = Dir.pwd
|
18
|
+
|
19
|
+
if options[:app].nil?
|
20
|
+
apps = Dir.glob("#{Dir.pwd}/homesteading-*/")
|
21
|
+
else
|
22
|
+
apps = Dir.glob("#{Dir.pwd}/homesteading-#{options[:app]}/")
|
23
|
+
end
|
24
|
+
|
25
|
+
apps.each do |directory|
|
26
|
+
app = directory.split("/").last.sub(/homesteading-/, "").downcase
|
27
|
+
app_file_path = directory + "app.json"
|
28
|
+
|
29
|
+
if File.exist?(app_file_path) && File.exist?(directory + ".git")
|
30
|
+
if options[:verbose]
|
31
|
+
g = Git.open(directory, :log => Logger.new(STDOUT))
|
32
|
+
else
|
33
|
+
g = Git.open(directory)
|
34
|
+
end
|
35
|
+
|
36
|
+
heroku_remote = g.remotes.map { |r| r if r.name == "heroku" }
|
37
|
+
|
38
|
+
if heroku_remote.first
|
39
|
+
puts "* Deploying #{app}..."
|
40
|
+
g.push(g.remote("heroku"))
|
41
|
+
puts "* ...done"
|
42
|
+
else
|
43
|
+
puts "* Tried deploying #{app}..."
|
44
|
+
puts "* No git remote named 'heroku'"
|
45
|
+
puts "* TODO: heroku app create setup"
|
46
|
+
puts "* ...done"
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
puts
|
52
|
+
end
|
53
|
+
|
54
|
+
private
|
55
|
+
def parse_options
|
56
|
+
# Parse command line options
|
57
|
+
options = {}
|
58
|
+
|
59
|
+
optparse = OptionParser.new do |opts|
|
60
|
+
opts.on("-a", "--app APP", "Name of Homesteading app on GitHub") do |app|
|
61
|
+
options[:app] = app
|
62
|
+
end
|
63
|
+
|
64
|
+
opts.on("-v", "--verbose", "Print all of status output") do |verbose|
|
65
|
+
options[:verbose] = verbose
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
optparse.parse!
|
70
|
+
options
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -61,13 +61,9 @@ module Homesteading
|
|
61
61
|
routes << "#{app_path}:#{app_port}"
|
62
62
|
end
|
63
63
|
|
64
|
-
if app_name =~ /homesteading-
|
64
|
+
if app_name =~ /homesteading-router-rack/
|
65
65
|
# TODO TEMP FIXME serve assets from hub
|
66
66
|
# skipping assets and router
|
67
|
-
elsif app_name == "homesteading-feed"
|
68
|
-
# TODO TEMP FIXME no bin/rails
|
69
|
-
puts "* Starting on port #{app_port} : #{app_name.sub(/homesteading-/, "")}"
|
70
|
-
servers << IO.popen("cd #{directory} && rails server -p #{app_port}", "w")
|
71
67
|
else
|
72
68
|
puts "* Starting on port #{app_port} : #{app_name.sub(/homesteading-/, "")}"
|
73
69
|
servers << IO.popen("cd #{directory} && bin/rails server -d --port #{app_port}", "w")
|
data/lib/homesteading/version.rb
CHANGED
@@ -0,0 +1,10 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
require "homesteading/command"
|
3
|
+
|
4
|
+
describe Homesteading::Command do
|
5
|
+
describe ".register" do
|
6
|
+
it "adds a command into the COMMANDS constant" do
|
7
|
+
expect(Homesteading::Command.create(:test_command)).to be_a TestCommand
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
require "homesteading"
|
2
|
+
require "homesteading/command"
|
3
|
+
|
4
|
+
Dir[File.join(File.dirname(__FILE__), "support", "**", "*.rb")].each { |f| require f }
|
5
|
+
|
6
|
+
RSpec.configure do |config|
|
7
|
+
config.filter_run :focus
|
8
|
+
config.run_all_when_everything_filtered = true
|
9
|
+
config.order = :random
|
10
|
+
Kernel.srand config.seed
|
11
|
+
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shane Becker
|
@@ -9,35 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
date: 2014-12-10 00:00:00.000000000 Z
|
12
|
-
dependencies:
|
13
|
-
- !ruby/object:Gem::Dependency
|
14
|
-
name: bundler
|
15
|
-
requirement: !ruby/object:Gem::Requirement
|
16
|
-
requirements:
|
17
|
-
- - "~>"
|
18
|
-
- !ruby/object:Gem::Version
|
19
|
-
version: '1.7'
|
20
|
-
type: :development
|
21
|
-
prerelease: false
|
22
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
-
requirements:
|
24
|
-
- - "~>"
|
25
|
-
- !ruby/object:Gem::Version
|
26
|
-
version: '1.7'
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rake
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - "~>"
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: '10.4'
|
34
|
-
type: :development
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - "~>"
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: '10.4'
|
12
|
+
dependencies: []
|
41
13
|
description: The Homesteading CLI is used to create, update and deploy a constellation
|
42
14
|
of homesteading apps that together make up a website powered by Homesteading.
|
43
15
|
email:
|
@@ -48,8 +20,10 @@ extensions: []
|
|
48
20
|
extra_rdoc_files: []
|
49
21
|
files:
|
50
22
|
- ".gitignore"
|
23
|
+
- ".travis.yml"
|
51
24
|
- Gemfile
|
52
25
|
- Gemfile.lock
|
26
|
+
- Guardfile
|
53
27
|
- LICENSE.md
|
54
28
|
- README.md
|
55
29
|
- Rakefile
|
@@ -77,6 +51,7 @@ files:
|
|
77
51
|
- lib/homesteading.rb
|
78
52
|
- lib/homesteading/command.rb
|
79
53
|
- lib/homesteading/commands/apps.rb
|
54
|
+
- lib/homesteading/commands/deploy.rb
|
80
55
|
- lib/homesteading/commands/help.rb
|
81
56
|
- lib/homesteading/commands/init.rb
|
82
57
|
- lib/homesteading/commands/new.rb
|
@@ -85,6 +60,11 @@ files:
|
|
85
60
|
- lib/homesteading/commands/update.rb
|
86
61
|
- lib/homesteading/commands/version.rb
|
87
62
|
- lib/homesteading/version.rb
|
63
|
+
- spec/homesteading/command_spec.rb
|
64
|
+
- spec/homesteading/commands/help_spec.rb
|
65
|
+
- spec/homesteading_spec.rb
|
66
|
+
- spec/spec_helper.rb
|
67
|
+
- spec/support/test_command.rb
|
88
68
|
homepage: http://homesteading.io
|
89
69
|
licenses:
|
90
70
|
- Public Domain, CC0
|
@@ -95,9 +75,9 @@ require_paths:
|
|
95
75
|
- lib
|
96
76
|
required_ruby_version: !ruby/object:Gem::Requirement
|
97
77
|
requirements:
|
98
|
-
- - "
|
78
|
+
- - "~>"
|
99
79
|
- !ruby/object:Gem::Version
|
100
|
-
version: '0'
|
80
|
+
version: '2.0'
|
101
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
102
82
|
requirements:
|
103
83
|
- - ">="
|
@@ -105,8 +85,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
85
|
version: '0'
|
106
86
|
requirements: []
|
107
87
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.4.
|
88
|
+
rubygems_version: 2.4.5
|
109
89
|
signing_key:
|
110
90
|
specification_version: 4
|
111
91
|
summary: Client library and command-line tool to deploy and manage Homesteading apps
|
112
|
-
test_files:
|
92
|
+
test_files:
|
93
|
+
- spec/homesteading/command_spec.rb
|
94
|
+
- spec/homesteading/commands/help_spec.rb
|
95
|
+
- spec/homesteading_spec.rb
|
96
|
+
- spec/spec_helper.rb
|
97
|
+
- spec/support/test_command.rb
|