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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d41012c5cf25936b063cac45455c91f8df72c39a
4
- data.tar.gz: 881ca530b7404d9d34c6f3aa809a5e381a880676
3
+ metadata.gz: a82750c6c682b84fb5bfb2166b6a0dbbc01c3da0
4
+ data.tar.gz: 78a9abdf91ea7819a1ede910f07eda5f4be57811
5
5
  SHA512:
6
- metadata.gz: 2f1d35f5ea21cdf887afa8e1659f53b017c4644c9846f12de069bcfd480b8138ee9c265b3917ae76baa82e8ec7be8b6394d86fe8600b019ed04bbf606f6179d1
7
- data.tar.gz: 0e08056a1cf6d24c09893d1e71dc3e79f8693ed3e6cdbd9569fb94e4ba163983f05ceace2eeb9881aa822e0a63a6b7232030f245cda0dd4dd909b4506c8f572b
6
+ metadata.gz: cf06b41d47bff573e9ec52f7dee74219ef405fcd4548686e6dc3cc45601932dfad1944c235bb4a609751ff3fe7449251cffe8ee30a18a92d58adc11e3e016294
7
+ data.tar.gz: 858c29ad2fddeec866a53e17783cd264747b9fc5c8d9b17ab0a42401fd8ca2974d2da1b7cb26bcca158a4be62fe428d36e27df185e4fdbd9171cfc224265a36c
data/.travis.yml ADDED
@@ -0,0 +1,5 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.3
4
+ env:
5
+ secure: P/xMGPxQb2TkNGEvGcczPMiXtlq/T+5I9TMXsAQUTXsn8fdBx7sTcC7DG4HUgS3eqdTcUV2NNG9oyQdWDcYj99QDsambIHTwNDCc5iGWMPWTaThO8krbW2lJYHC3RWE21iGQEG5aGjGZ706rWoLxwKtaGQxCkGXsDkQ+aG1hBvE=
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.1)
4
+ homesteading (0.3.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- rake (10.4.0)
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
- rake (~> 10.0)
80
+ puma (~> 2.10)
81
+ rake (~> 10.4)
82
+ rspec
data/Guardfile ADDED
@@ -0,0 +1,5 @@
1
+ guard :rspec, cmd: "bundle exec rspec", all_on_start: true, all_after_pass: true do
2
+ watch(%r{^spec/.+_spec\.rb$})
3
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
4
+ watch("spec/spec_helper.rb") { "spec" }
5
+ end
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.1.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://www.ruby-lang.org/en/ "Ruby Programming Language")
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
@@ -1,2 +1,6 @@
1
1
  require "bundler/gem_tasks"
2
2
 
3
+ require 'rspec/core/rake_task'
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task default: :spec
@@ -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 = `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
-
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
@@ -1,19 +1,22 @@
1
1
  module Homesteading
2
2
  class Command
3
- COMMANDS = {}
3
+ class << self
4
+ COMMANDS = {}
4
5
 
5
- def self.register(name, *aliases)
6
- COMMANDS[name] = self
6
+ def register(name, *aliases)
7
+ COMMANDS[name] = self
7
8
 
8
- aliases.each do |a|
9
- COMMANDS[a] = self
9
+ aliases.each do |a|
10
+ COMMANDS[a] = self
11
+ end
10
12
  end
11
- end
12
13
 
13
- def self.create(name)
14
- if klass = COMMANDS[name]
15
- klass.new
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-assets|homesteading-router-rack/
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")
@@ -6,7 +6,9 @@ module Homesteading
6
6
  register "version"
7
7
 
8
8
  def default
9
+ puts
9
10
  puts "Homesteading #{Homesteading::VERSION}, codename: #{Homesteading::CODENAME}"
11
+ puts
10
12
  end
11
13
  end
12
14
  end
@@ -1,4 +1,4 @@
1
1
  module Homesteading
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  CODENAME = "The Rooftop Series"
4
4
  end
@@ -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
@@ -0,0 +1,10 @@
1
+ require "spec_helper"
2
+ require "homesteading/commands/help"
3
+
4
+ describe Homesteading::Help do
5
+ describe "#default" do
6
+ it "responds to it" do
7
+ expect(Homesteading::Help.new).to respond_to :default
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,7 @@
1
+ require "spec_helper"
2
+
3
+ describe Homesteading do
4
+ it "is a module" do
5
+ expect(Homesteading).to be_a Module
6
+ end
7
+ end
@@ -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
@@ -0,0 +1,4 @@
1
+ require "homesteading"
2
+ class TestCommand < Homesteading::Command
3
+ register :test_command
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.2.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.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