travis_reprise 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/bin/travis_reprise CHANGED
@@ -15,8 +15,9 @@ unless user && repo && branch
15
15
  exit 1
16
16
  end
17
17
 
18
+ cfg_file = File.read(File.expand_path('~/.travis-reprise.json'))
18
19
  begin
19
- config = JSON.parse(File.read(File.expand_path('~/.travis-reprise.json')))
20
+ config = JSON.parse(cfg_file)
20
21
  rescue Errno::ENOENT
21
22
  $stdout.sync = true
22
23
  print "Github Username: "
@@ -30,9 +31,10 @@ rescue Errno::ENOENT
30
31
  json = `curl -u '#{u}:#{p}' -d '{"scopes":["repo"],"note":"Travis Reprise"}' https://api.github.com/authorizations 2>/dev/null`
31
32
  data = JSON.parse(json)
32
33
  if data['token']
33
- File.open(File.expand_path('~/.travis-reprise.json'), 'w') do |f|
34
+ File.open(cfg_file, 'w') do |f|
34
35
  f << json
35
36
  end
37
+ `chmod 600 #{cfg_file}`
36
38
  else
37
39
  puts "#{data['message']}: try again"
38
40
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "travis_reprise"
5
- s.version = '0.1.2'
5
+ s.version = '0.1.3'
6
6
  s.platform = Gem::Platform::RUBY
7
7
  s.summary = %q{Trigger travis rebuilds easily}
8
8
  s.author = 'dev@bigcartel.com'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: travis_reprise
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: