meroku 0.1.36 → 2.0.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: 1fab3d36f45378aa59a84fc257ce6d9345ef595c
4
- data.tar.gz: 84f8f421c5c7e795ead29392f81b9108e0a5ebb3
3
+ metadata.gz: e3bc8e4f9e626440d5caa8fb2bb3c9d0a63cfe7b
4
+ data.tar.gz: 17c01df14516e4af643ee0a93305b2071214d60d
5
5
  SHA512:
6
- metadata.gz: 4e00f9cb57c26266c9efae0ee5a382d5c09ea5280308f1cd0ca8da2ac9929cfacd07c7aace13d8cf976eb7a26affc7906b9bef900496a6ab11f41440dabb81b7
7
- data.tar.gz: 3c22eeeb9f45fe757720c659e59b6fac0d4869d7b5c6d0c75725e43d5cf02b6a619cd54c6366d7dae6dc6b18298a57b5f03e570470e29d58ec776ae0e8f3b480
6
+ metadata.gz: 20cb245d3dc36d712c1d00ed833397b22d726179f38541b34044608b64e811488782fd0d1ed9aa3fd2f45894e88f01007e8640782e6f80042cbecd6b2ecb21e9
7
+ data.tar.gz: 9f4b8e1637c0b263fcb8f9d143d91ed09952ab9674b8de6b51a8d6d3e43b733f767a74d7807034e066882f83768e72820e1a70c31af5f5ec711b0d02c5a244ae
@@ -0,0 +1,2 @@
1
+ AWS_ACCESS_KEY="EXAMPLE"
2
+ AWS_SECRET="EXAMPLE"
@@ -0,0 +1,10 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ .env
@@ -0,0 +1,5 @@
1
+ sudo: false
2
+ language: ruby
3
+ rvm:
4
+ - 2.4.2
5
+ before_install: gem install bundler -v 1.15.4
data/Gemfile ADDED
@@ -0,0 +1,6 @@
1
+ source "https://rubygems.org"
2
+
3
+ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
+
5
+ # Specify your gem's dependencies in meroku.gemspec
6
+ gemspec
@@ -0,0 +1,58 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ ## Uncomment and set this to only include directories you want to watch
5
+ # directories %w(app lib config test spec features) \
6
+ # .select{|d| Dir.exists?(d) ? d : UI.warning("Directory #{d} does not exist")}
7
+
8
+ ## Note: if you are using the `directories` clause above and you are not
9
+ ## watching the project directory ('.'), then you will want to move
10
+ ## the Guardfile to a watched dir and symlink it back, e.g.
11
+ #
12
+ # $ mkdir config
13
+ # $ mv Guardfile config/
14
+ # $ ln -s config/Guardfile .
15
+ #
16
+ # and, you'll have to watch "config/Guardfile" instead of "Guardfile"
17
+
18
+ guard :minitest do
19
+ # with Minitest::Unit
20
+ watch(%r{^test/(.*)\/?test_(.*)\.rb$})
21
+ watch(%r{^lib/(.*/)?([^/]+)\.rb$}) { |m| "test/#{m[1]}test_#{m[2]}.rb" }
22
+ watch('lib/meroku.rb') { 'test/meroku_test.rb' }
23
+ watch(%r{^test/test_helper\.rb$}) { 'test' }
24
+
25
+ # with Minitest::Spec
26
+ # watch(%r{^spec/(.*)_spec\.rb$})
27
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
28
+ # watch(%r{^spec/spec_helper\.rb$}) { 'spec' }
29
+
30
+ # Rails 4
31
+ # watch(%r{^app/(.+)\.rb$}) { |m| "test/#{m[1]}_test.rb" }
32
+ # watch(%r{^app/controllers/application_controller\.rb$}) { 'test/controllers' }
33
+ # watch(%r{^app/controllers/(.+)_controller\.rb$}) { |m| "test/integration/#{m[1]}_test.rb" }
34
+ # watch(%r{^app/views/(.+)_mailer/.+}) { |m| "test/mailers/#{m[1]}_mailer_test.rb" }
35
+ # watch(%r{^lib/(.+)\.rb$}) { |m| "test/lib/#{m[1]}_test.rb" }
36
+ # watch(%r{^test/.+_test\.rb$})
37
+ # watch(%r{^test/test_helper\.rb$}) { 'test' }
38
+
39
+ # Rails < 4
40
+ # watch(%r{^app/controllers/(.*)\.rb$}) { |m| "test/functional/#{m[1]}_test.rb" }
41
+ # watch(%r{^app/helpers/(.*)\.rb$}) { |m| "test/helpers/#{m[1]}_test.rb" }
42
+ # watch(%r{^app/models/(.*)\.rb$}) { |m| "test/unit/#{m[1]}_test.rb" }
43
+ end
44
+
45
+ # Add files and commands to this file, like the example:
46
+ # watch(%r{file/path}) { `command(s)` }
47
+ #
48
+ guard :shell do
49
+
50
+ watch /.*/ do |m|
51
+ m[0] + " has changed."
52
+ end
53
+
54
+ #watch /.*/ do |m|
55
+ # #watch /(.*)/ do |m|
56
+ # `meroku && echo 'guard-shell-SUCCESS'`
57
+ #end
58
+ end
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Sam Weerasinghe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,16 @@
1
+
2
+
3
+ [![Build Status](https://travis-ci.org/oystersauce8/meroku.svg?branch=master)](https://travis-ci.org/oystersauce8/meroku)
4
+ [![Coverage Status](https://coveralls.io/repos/github/oystersauce8/meroku/badge.svg?branch=master)](https://coveralls.io/github/oystersauce8/meroku?branch=master)
5
+ [![Maintainability](https://api.codeclimate.com/v1/badges/266f087c272cd3ca268e/maintainability)](https://codeclimate.com/github/oystersauce8/meroku/maintainability)
6
+
7
+ $ meroku infrastructure spawn
8
+ $ meroku infrastructure despawn
9
+
10
+
11
+ # Run tests
12
+
13
+ rake; bats test/bash/;
14
+
15
+ fswatch -o ~/meroku/ | xargs -I % sh -c 'rake; bats test/bash/; ' # auto run
16
+
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/testtask"
3
+
4
+ Rake::TestTask.new(:test) do |t|
5
+ t.libs << "test"
6
+ t.libs << "lib"
7
+ t.test_files = FileList["test/**/*_test.rb"]
8
+ end
9
+
10
+ task :default => :test
@@ -0,0 +1,6 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
4
+ require 'meroku'
5
+
6
+ Meroku.cli_start(*ARGV)
data/exe/meroku CHANGED
@@ -1,5 +1,9 @@
1
1
  #!/usr/bin/env ruby
2
- require "meroku"
3
- Meroku::CLI::Cli.start
2
+ # The command line Haml parser.
4
3
 
4
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
5
+ require 'haml'
6
+ require 'haml/exec'
5
7
 
8
+ opts = Meroku::Exec::Haml.new(ARGV)
9
+ opts.parse!
@@ -1,21 +1,30 @@
1
1
  require "meroku/version"
2
- require "meroku/util"
3
- require "meroku/sanitychecks"
4
- require "meroku/cli"
5
- require "meroku/cli/server"
6
- require "meroku/cli/keys"
7
- require "meroku/cli/domains"
8
- require "meroku/cli/remote"
9
- require "meroku/cli/certs"
10
- require "meroku/cli/config"
11
- require "meroku/cli/cli"
12
-
13
- require "meroku/error"
14
- require "meroku/core_ext"
15
- require 'aws-sdk'
2
+ require "meroku/infrastructure"
3
+ require 'aws-sdk-ec2'
4
+ require 'dotenv/load'
16
5
 
17
6
  module Meroku
18
7
 
19
- PRODUCTION_IP = "34.239.241.218"
8
+ def self.cli_start(*args)
9
+ case args.join(" ")
10
+ when "infrastructure spawn"
11
+ Meroku::Infrastructure.spawn
12
+ when "infrastructure despawn"
13
+ Meroku::Infrastructure.despawn
14
+ else
15
+ print_help
16
+ end
17
+ end
20
18
 
19
+ def self.print_help
20
+ puts <<~HEREDOC
21
+ Usage: meroku command subcommand
22
+
23
+ Examples
24
+
25
+ meroku infrastrucuture spawn # Spawns server
26
+
27
+ HEREDOC
28
+ end
29
+
21
30
  end
@@ -0,0 +1,24 @@
1
+ module Meroku
2
+ module Infrastructure
3
+ def self.spawn
4
+ credentials = Aws::Credentials.new(ENV['AWS_ACCESS_KEY'], ENV['AWS_SECRET'])
5
+ ec2_client = Aws::EC2::Client.new(region: 'us-east-1', credentials: credentials)
6
+ ec2_client.run_instances(
7
+ image_id: 'ami-cd0f5cb6',
8
+ min_count: 1,
9
+ max_count: 1,
10
+ key_name: 'meroku.id_rsa',
11
+ instance_type: 't2.micro',
12
+ ).instances.first
13
+ end
14
+
15
+ def self.despawn
16
+ resp = nil
17
+ credentials = Aws::Credentials.new(ENV['AWS_ACCESS_KEY'], ENV['AWS_SECRET'])
18
+ ec2 = Aws::EC2::Resource.new(region: 'us-east-1', credentials: credentials)
19
+ running_instance = ec2.instances.detect { |i| i.exists? && i.state.code!=48 }
20
+ resp = running_instance.terminate if running_instance
21
+ resp
22
+ end
23
+ end
24
+ end
@@ -1,3 +1,3 @@
1
1
  module Meroku
2
- VERSION = "0.1.36"
2
+ VERSION = "2.0.0"
3
3
  end
@@ -0,0 +1,40 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "meroku/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "meroku"
8
+ spec.version = Meroku::VERSION
9
+ spec.authors = ["Sam Weerasinghe"]
10
+ spec.email = ["oystersauce8@gmail.com"]
11
+
12
+ spec.summary = %q{Summary}
13
+ spec.description = %q{Description}
14
+ spec.homepage = "http://example.net"
15
+ spec.license = "MIT"
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
18
+ f.match(%r{^(test|spec|features)/})
19
+ end
20
+ spec.bindir = "bin"
21
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
22
+ spec.require_paths = ["lib"]
23
+
24
+ spec.add_runtime_dependency "aws-sdk", "~> 3"
25
+ spec.add_runtime_dependency "dotenv", "~> 2.2.1"
26
+
27
+ spec.add_development_dependency "bundler", "~> 1.15"
28
+ spec.add_development_dependency "rake", "~> 10.0"
29
+ spec.add_development_dependency "minitest", "~> 5.0"
30
+
31
+ spec.add_development_dependency "guard", "~>2.14.1"
32
+ spec.add_development_dependency "guard-minitest", "~>2.4.6"
33
+ spec.add_development_dependency "guard-shell", "~>0.7.1"
34
+ spec.add_development_dependency "byebug", "~> 9.1.0"
35
+ spec.add_development_dependency "simplecov", "~> 0.14.1"
36
+ spec.add_development_dependency "coveralls", "~> 0.8.21"
37
+ spec.add_development_dependency "mocha", "~> 1.3.0"
38
+
39
+ end
40
+
metadata CHANGED
@@ -1,29 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meroku
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.36
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Meroku System
7
+ - Sam Weerasinghe
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-29 00:00:00.000000000 Z
11
+ date: 2017-10-18 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: aws-sdk
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '3'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '3'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dotenv
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 2.2.1
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 2.2.1
13
41
  - !ruby/object:Gem::Dependency
14
42
  name: bundler
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
- - - ">="
45
+ - - "~>"
18
46
  - !ruby/object:Gem::Version
19
- version: '0'
47
+ version: '1.15'
20
48
  type: :development
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
- - - ">="
52
+ - - "~>"
25
53
  - !ruby/object:Gem::Version
26
- version: '0'
54
+ version: '1.15'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: rake
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -39,144 +67,146 @@ dependencies:
39
67
  - !ruby/object:Gem::Version
40
68
  version: '10.0'
41
69
  - !ruby/object:Gem::Dependency
42
- name: rack
70
+ name: minitest
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
- - - '='
73
+ - - "~>"
46
74
  - !ruby/object:Gem::Version
47
- version: 1.6.8
48
- type: :runtime
75
+ version: '5.0'
76
+ type: :development
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
51
79
  requirements:
52
- - - '='
80
+ - - "~>"
53
81
  - !ruby/object:Gem::Version
54
- version: 1.6.8
82
+ version: '5.0'
55
83
  - !ruby/object:Gem::Dependency
56
- name: thor
84
+ name: guard
57
85
  requirement: !ruby/object:Gem::Requirement
58
86
  requirements:
59
- - - ">="
87
+ - - "~>"
60
88
  - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :runtime
89
+ version: 2.14.1
90
+ type: :development
63
91
  prerelease: false
64
92
  version_requirements: !ruby/object:Gem::Requirement
65
93
  requirements:
66
- - - ">="
94
+ - - "~>"
67
95
  - !ruby/object:Gem::Version
68
- version: '0'
96
+ version: 2.14.1
69
97
  - !ruby/object:Gem::Dependency
70
- name: aws-sdk
98
+ name: guard-minitest
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
- - - ">="
101
+ - - "~>"
74
102
  - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :runtime
103
+ version: 2.4.6
104
+ type: :development
77
105
  prerelease: false
78
106
  version_requirements: !ruby/object:Gem::Requirement
79
107
  requirements:
80
- - - ">="
108
+ - - "~>"
81
109
  - !ruby/object:Gem::Version
82
- version: '0'
110
+ version: 2.4.6
83
111
  - !ruby/object:Gem::Dependency
84
- name: dotenv
112
+ name: guard-shell
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
- - - ">="
115
+ - - "~>"
88
116
  - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :runtime
117
+ version: 0.7.1
118
+ type: :development
91
119
  prerelease: false
92
120
  version_requirements: !ruby/object:Gem::Requirement
93
121
  requirements:
94
- - - ">="
122
+ - - "~>"
95
123
  - !ruby/object:Gem::Version
96
- version: '0'
124
+ version: 0.7.1
97
125
  - !ruby/object:Gem::Dependency
98
- name: rest-client
126
+ name: byebug
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
- - - '='
129
+ - - "~>"
102
130
  - !ruby/object:Gem::Version
103
- version: 1.6.8
104
- type: :runtime
131
+ version: 9.1.0
132
+ type: :development
105
133
  prerelease: false
106
134
  version_requirements: !ruby/object:Gem::Requirement
107
135
  requirements:
108
- - - '='
136
+ - - "~>"
109
137
  - !ruby/object:Gem::Version
110
- version: 1.6.8
138
+ version: 9.1.0
111
139
  - !ruby/object:Gem::Dependency
112
- name: activesupport
140
+ name: simplecov
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
- - - ">="
143
+ - - "~>"
116
144
  - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :runtime
145
+ version: 0.14.1
146
+ type: :development
119
147
  prerelease: false
120
148
  version_requirements: !ruby/object:Gem::Requirement
121
149
  requirements:
122
- - - ">="
150
+ - - "~>"
123
151
  - !ruby/object:Gem::Version
124
- version: '0'
152
+ version: 0.14.1
125
153
  - !ruby/object:Gem::Dependency
126
- name: actionview
154
+ name: coveralls
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
- - - '='
157
+ - - "~>"
130
158
  - !ruby/object:Gem::Version
131
- version: 4.1.1
132
- type: :runtime
159
+ version: 0.8.21
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: 0.8.21
167
+ - !ruby/object:Gem::Dependency
168
+ name: mocha
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "~>"
172
+ - !ruby/object:Gem::Version
173
+ version: 1.3.0
174
+ type: :development
133
175
  prerelease: false
134
176
  version_requirements: !ruby/object:Gem::Requirement
135
177
  requirements:
136
- - - '='
178
+ - - "~>"
137
179
  - !ruby/object:Gem::Version
138
- version: 4.1.1
139
- description:
180
+ version: 1.3.0
181
+ description: Description
140
182
  email:
141
- - meroku.system@gmail.com
183
+ - oystersauce8@gmail.com
142
184
  executables:
185
+ - console
143
186
  - meroku
187
+ - setup
144
188
  extensions: []
145
189
  extra_rdoc_files: []
146
190
  files:
191
+ - ".env.example"
192
+ - ".gitignore"
193
+ - ".travis.yml"
194
+ - Gemfile
195
+ - Guardfile
196
+ - LICENSE.txt
197
+ - README.md
198
+ - Rakefile
147
199
  - bin/console
200
+ - bin/meroku
148
201
  - bin/setup
149
202
  - exe/meroku
150
203
  - lib/meroku.rb
151
- - lib/meroku/app.rb
152
- - lib/meroku/app/collaborator.rb
153
- - lib/meroku/application_record.rb
154
- - lib/meroku/apps_controller.rb
155
- - lib/meroku/cli.rb
156
- - lib/meroku/cli/certs.rb
157
- - lib/meroku/cli/certs.rb~
158
- - lib/meroku/cli/cli.rb
159
- - lib/meroku/cli/config.rb
160
- - lib/meroku/cli/domains.rb
161
- - lib/meroku/cli/keys.rb
162
- - lib/meroku/cli/remote.rb
163
- - lib/meroku/cli/remote.rb~
164
- - lib/meroku/cli/server.rb
165
- - lib/meroku/cli/server.rb~
166
- - lib/meroku/config.rb
167
- - lib/meroku/configs_controller.rb
168
- - lib/meroku/core_ext.rb
169
- - lib/meroku/domain.rb
170
- - lib/meroku/domains_controller.rb
171
- - lib/meroku/error.rb
172
- - lib/meroku/key.rb
173
- - lib/meroku/keys_controller.rb
174
- - lib/meroku/sanitychecks.rb
175
- - lib/meroku/user.rb
176
- - lib/meroku/util.rb
204
+ - lib/meroku/infrastructure.rb
177
205
  - lib/meroku/version.rb
206
+ - meroku.gemspec
178
207
  homepage: http://example.net
179
- licenses: []
208
+ licenses:
209
+ - MIT
180
210
  metadata: {}
181
211
  post_install_message:
182
212
  rdoc_options: []
@@ -194,8 +224,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
224
  version: '0'
195
225
  requirements: []
196
226
  rubyforge_project:
197
- rubygems_version: 2.6.12
227
+ rubygems_version: 2.6.13
198
228
  signing_key:
199
229
  specification_version: 4
200
- summary: The command line tool for meroku.com
230
+ summary: Summary
201
231
  test_files: []