shred 0.0.3 → 0.0.4

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: dc7d3395add485fc83816532c717b9e507d2a4ca
4
- data.tar.gz: 2e51812cfbc8b84d64c69444cb88806600e6ee9f
3
+ metadata.gz: b2e054fbed6a3aea3fa024120dc4f04ab56b8d11
4
+ data.tar.gz: fb5a6578711711182bce19418638681f09336a31
5
5
  SHA512:
6
- metadata.gz: 7b78a34732cba64175900fcc65bad96316222c35478dd3fefb30ab6cf7a52eed68acd56a4823a07ae11b268f6b15c6fa353bf54553f47ed5fcfaa823815d0471
7
- data.tar.gz: d829b8587f15cac0c577387bd15a3a2790e304bb805b7a8909d6010a6e9dc921474d96f6f5e585837bb51671b3e45e472a81464e64e444bbfffee9a3912a60ef
6
+ metadata.gz: 766546e3f1b2d13863dab3658da6809487569516f8c12319ede06c5e19473ee0dd8b57dee953fc2d327344f4b844882d5370dc6cd49dc02b35cc1ef40c4c477f
7
+ data.tar.gz: 84d5c56ea550317e12c2d772cbf1b7ea744858dfb7bba05746d20d40ead486b329b530fdad88fe74c97f805f847cd8049b755f20f40f7ebb57de135adc48a50d
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ shred.yml
data/bin/shredify ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH << File.join(Dir.pwd, 'lib')
4
+
5
+ require 'shred'
6
+
7
+ Shred::Generator.start(ARGV.unshift(File.basename(Dir.pwd)))
@@ -19,33 +19,29 @@ module Shred
19
19
  def heroku
20
20
  app_name = cfg('heroku.app_name')
21
21
  vars = cfg('heroku.vars')
22
- mode = cfg('heroku.mode') == 'a' ? 'a' : 'w'
23
22
  custom = cfg('custom.vars', required: false)
24
23
 
25
24
  run_shell_command(ShellCommand.new(command_lines: 'heroku auth:whoami'))
26
25
 
26
+ io = StringIO.new
27
27
  run_shell_command(ShellCommand.new(
28
28
  command_lines: "heroku config --app #{app_name} --shell",
29
- output: '.heroku.env'
29
+ output: io
30
30
  ))
31
31
 
32
- File.open('.env', mode) do |output|
33
- File.open('.heroku.env') do |input|
34
- input.readlines.each do |line|
35
- line.chomp!
36
- if line =~ /^([^=]+)=/ && vars.include?($1)
37
- output.write("#{line}\n")
38
- end
32
+ File.open('.env', 'w') do |output|
33
+ io.string.split("\n").each do |line|
34
+ if line =~ /^([^=]+)=/ && vars.include?($1)
35
+ output.write("#{line}\n")
39
36
  end
40
37
  end
41
- File.unlink('.heroku.env')
42
- console.say_ok("Heroku config written to environment config file")
38
+ console.say_ok("Heroku config written to .env")
43
39
 
44
40
  if custom
45
41
  custom.each do |key, value|
46
42
  output.write("#{key}=#{value}\n")
47
43
  end
48
- console.say_ok("Custom config written to environment config file")
44
+ console.say_ok("Custom config written to .env")
49
45
  end
50
46
  end
51
47
  end
data/lib/shred/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Shred
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
data/lib/shred.rb CHANGED
@@ -77,4 +77,18 @@ module Shred
77
77
  attr_reader :config
78
78
  end
79
79
  end
80
+
81
+ class Generator < Thor::Group
82
+ include Thor::Actions
83
+
84
+ argument :app_name
85
+
86
+ def self.source_root
87
+ File.dirname(__FILE__)
88
+ end
89
+
90
+ def create_config_file
91
+ template('shred.yml.tt', 'shred.yml')
92
+ end
93
+ end
80
94
  end
@@ -8,26 +8,23 @@ commands:
8
8
  staging:
9
9
  branch: master
10
10
  heroku:
11
- app_name: my-app-staging
11
+ app_name: <%= app_name %>-staging
12
12
  production:
13
13
  branch: production
14
14
  heroku:
15
- app_name: my-app-production
15
+ app_name: <%= app_name %>-production
16
16
  notifications:
17
17
  airbrake: bin/rake airbrake:deploy RAILS_ENV={environment} TO={environment}
18
18
  new_relic: bin/newrelic deployments -e {environment} -r {revision}
19
19
  dotenv:
20
20
  heroku:
21
- app_name: my-app
21
+ app_name: <%= app_name %>-staging
22
22
  vars:
23
23
  - AIRBRAKE_API_KEY
24
- mode: w
25
24
  custom:
26
25
  vars:
27
- RACK_ENV: none
28
26
  RAILS_ENV: development
29
- WEB_CONCURRENCY: 1
30
- mode: a
27
+ js_deps:
31
28
  platform_deps:
32
29
  homebrew:
33
30
  - postgres
@@ -60,10 +57,11 @@ commands:
60
57
  platform_deps: install
61
58
  services: start
62
59
  ruby_deps: install
60
+ js_deps: install
63
61
  db: init
64
62
  dotenv: heroku
65
63
  test:
66
64
  server:
67
65
  - bin/rake spec
68
66
  client:
69
- - bin/rake konacha:run
67
+ - bin/rake teaspoon:run
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shred
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian
@@ -87,6 +87,7 @@ email:
87
87
  - bcm@maz.org
88
88
  executables:
89
89
  - shred
90
+ - shredify
90
91
  extensions: []
91
92
  extra_rdoc_files: []
92
93
  files:
@@ -96,7 +97,9 @@ files:
96
97
  - README.md
97
98
  - Rakefile
98
99
  - bin/shred
100
+ - bin/shredify
99
101
  - lib/shred.rb
102
+ - lib/shred.yml.tt
100
103
  - lib/shred/commands/app.rb
101
104
  - lib/shred/commands/base.rb
102
105
  - lib/shred/commands/db.rb
@@ -109,7 +112,6 @@ files:
109
112
  - lib/shred/commands/test.rb
110
113
  - lib/shred/version.rb
111
114
  - shred.gemspec
112
- - shred.yml
113
115
  homepage: http://github.com/bcm/shred
114
116
  licenses:
115
117
  - MIT