git-semaphore 0.0.7 → 0.0.9

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: 967b795337dc7bf2114afa2409f5f49cfe4d4d5a
4
- data.tar.gz: dd2b015bad90a68e3d783de7ba2c495c8082ddb0
3
+ metadata.gz: b86473a790890b9ce221b9f1a41143a6b11c63ee
4
+ data.tar.gz: cf5a879705922db3a175eb1294df94fda33cde54
5
5
  SHA512:
6
- metadata.gz: 5b3c339ea8d617f7e8826cd24c301baad284836ee495223b61823d8736536c6f0e9487894c8c881cc5470fa0c92b900ddad2aa0e31a4380161dffb9995fbb471
7
- data.tar.gz: 8e4355613495bf582b7ef3a567ff5b7a2157d925fe58c2fa6f4c540b89f23a66deac144552dc10fdefbe610bb829de52444d51633a209f0e3f24421477b20220
6
+ metadata.gz: 72be87873ee8f9ac9dc50780560bf04a086c2238f7aa73eb1ff8b83971a9e13f18ca2b466f813bdc00e15c14e062b76f01f41c95f18834d74f36d660bb590161
7
+ data.tar.gz: 1e9f18f4dd33f89ca2c895ea274ebee95f826b0706c1e968dfcaa3a0cc8e171510ad311f15a6e75dadbaffea31a0672af62a9ebefbc1910771008705175e96ff
data/bin/git-semaphore CHANGED
@@ -4,116 +4,112 @@ $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib
4
4
 
5
5
  require 'git-semaphore'
6
6
 
7
- if __FILE__ == $0
7
+ options = Trollop::options do
8
8
 
9
- options = Trollop::options do
9
+ version Git::Semaphore::COPYRIGHT
10
+ banner Git::Semaphore::BANNER
10
11
 
11
- version Git::Semaphore::COPYRIGHT
12
- banner Git::Semaphore::BANNER
12
+ opt :projects, 'List all semaphore.app projects', :short => nil, :default => false
13
+ opt :branches, 'List all semaphore.app branches for current project', :short => nil, :default => false
14
+ opt :status, 'List the semaphore.app status for the given branch', :short => nil, :default => false
15
+ opt :'commit-status', 'Check commit status', :default => false
16
+ opt :'rebuild-last-revision', 'Rebuild last revision', :default => false
13
17
 
14
- opt :projects, 'List all semaphore.app projects', :short => nil, :default => false
15
- opt :branches, 'List all semaphore.app branches for current project', :short => nil, :default => false
16
- opt :status, 'List the semaphore.app status for the given branch', :short => nil, :default => false
17
- opt :'commit-status', 'Check commit status', :default => false
18
- opt :'rebuild-last-revision', 'Rebuild last revision', :default => false
18
+ opt :'working-dir', 'Print working dir', :short => 'w', :default => false
19
+ opt :'project-name', 'Print project name', :short => 'p', :default => false
20
+ opt :'branch-name', 'Print branch name', :short => 'b', :default => false
19
21
 
20
- opt :'working-dir', 'Print working dir', :short => 'w', :default => false
21
- opt :'project-name', 'Print project name', :short => 'p', :default => false
22
- opt :'branch-name', 'Print branch name', :short => 'b', :default => false
22
+ opt :'check-auth', 'Check auth token', :short => 'x', :default => false
23
+ opt :'check-project', 'Check project hash id', :short => 'y', :default => false
24
+ opt :'check-branch', 'Check branch id', :short => 'z', :default => false
23
25
 
24
- opt :'check-auth', 'Check auth token', :short => 'x', :default => false
25
- opt :'check-project', 'Check project hash id', :short => 'y', :default => false
26
- opt :'check-branch', 'Check branch id', :short => 'z', :default => false
26
+ opt :'git-config', 'Print git settings', :short => 'g', :default => false
27
+ opt :'env-config', 'Print environment settings', :short => 'e', :default => false
27
28
 
28
- opt :'git-config', 'Print git settings', :short => 'g', :default => false
29
- opt :'env-config', 'Print environment settings', :short => 'e', :default => false
30
-
31
- end
32
-
33
- app = Git::Semaphore::App.new(Dir.pwd, ENV)
34
-
35
- if !app.validate
36
- r = app.git_repo rescue false
37
- unless r
38
- STDERR.puts "Error: \"#{Dir.pwd}\" is not a git working directory... exiting!"
39
- exit 255
40
- end
41
- end
29
+ end
42
30
 
43
- if options[:'rebuild-last-revision']
44
- puts app.rebuild_last_revision
45
- exit 0
46
- end
31
+ app = Git::Semaphore::App.new(Dir.pwd, ENV)
47
32
 
48
- if options[:'commit-status']
49
- puts app.commit_status
50
- exit 0
33
+ if !app.validate
34
+ r = app.git_repo rescue false
35
+ unless r
36
+ STDERR.puts "Error: \"#{Dir.pwd}\" is not a git working directory... exiting!"
37
+ exit 255
51
38
  end
39
+ end
52
40
 
53
- if options[:projects]
54
- puts app.projects
55
- exit 0
56
- end
41
+ if options[:'rebuild-last-revision']
42
+ puts app.rebuild_last_revision
43
+ exit 0
44
+ end
57
45
 
58
- if options[:branches]
59
- puts app.branches
60
- exit 0
61
- end
46
+ if options[:'commit-status']
47
+ puts app.commit_status
48
+ exit 0
49
+ end
62
50
 
63
- if options[:status]
64
- puts app.status
65
- exit 0
66
- end
51
+ if options[:projects]
52
+ puts app.projects
53
+ exit 0
54
+ end
67
55
 
68
- if options[:'working-dir']
69
- puts app.working_dir
70
- exit 0
71
- end
56
+ if options[:branches]
57
+ puts app.branches
58
+ exit 0
59
+ end
72
60
 
73
- if options[:'project-name']
74
- puts app.project_name
75
- exit 0
76
- end
61
+ if options[:status]
62
+ puts app.status
63
+ exit 0
64
+ end
77
65
 
78
- if options[:'branch-name']
79
- puts app.branch_name
80
- exit 0
81
- end
66
+ if options[:'working-dir']
67
+ puts app.working_dir
68
+ exit 0
69
+ end
82
70
 
83
- if options[:'check-auth']
84
- unless app.auth_token && !app.auth_token.empty?
85
- STDERR.puts 'Please set - and export - the SEMAPHORE_AUTH_TOKEN env variable'
86
- STDERR.puts 'Alternatively, set semaphore.authtoken in your local git config'
87
- exit -1
88
- else
89
- exit 0
90
- end
91
- end
71
+ if options[:'project-name']
72
+ puts app.project_name
73
+ exit 0
74
+ end
92
75
 
93
- if options[:'check-project']
94
- unless app.project_token && !app.project_token.empty?
95
- STDERR.puts 'Please set - and export - the SEMAPHORE_PROJECT_TOKEN env variable'
96
- STDERR.puts 'Alternatively, set semaphore.projecttoken in your local git config'
97
- exit -1
98
- else
99
- exit 0
100
- end
101
- end
76
+ if options[:'branch-name']
77
+ puts app.branch_name
78
+ exit 0
79
+ end
102
80
 
103
- if options[:'env-config']
104
- puts "export SEMAPHORE_AUTH_TOKEN=\"#{app.env_auth_token}\""
105
- puts "export SEMAPHORE_PROJECT_TOKEN=\"#{app.env_project_token}\""
81
+ if options[:'check-auth']
82
+ unless app.auth_token && !app.auth_token.empty?
83
+ STDERR.puts 'Please set - and export - the SEMAPHORE_AUTH_TOKEN env variable'
84
+ STDERR.puts 'Alternatively, set semaphore.authtoken in your local git config'
85
+ exit -1
86
+ else
106
87
  exit 0
107
88
  end
89
+ end
108
90
 
109
- if options[:'git-config']
110
- puts "git config --local --replace-all semaphore.authtoken \"#{app.git_auth_token}\""
111
- puts "git config --local --replace-all semaphore.projecttoken \"#{app.git_project_token}\""
91
+ if options[:'check-project']
92
+ unless app.project_token && !app.project_token.empty?
93
+ STDERR.puts 'Please set - and export - the SEMAPHORE_PROJECT_TOKEN env variable'
94
+ STDERR.puts 'Alternatively, set semaphore.projecttoken in your local git config'
95
+ exit -1
96
+ else
112
97
  exit 0
113
98
  end
99
+ end
114
100
 
115
- fail "Coming soon!"
101
+ if options[:'env-config']
102
+ puts "export SEMAPHORE_AUTH_TOKEN=\"#{app.env_auth_token}\""
103
+ puts "export SEMAPHORE_PROJECT_TOKEN=\"#{app.env_project_token}\""
104
+ exit 0
105
+ end
116
106
 
107
+ if options[:'git-config']
108
+ puts "git config --local --replace-all semaphore.authtoken \"#{app.git_auth_token}\""
109
+ puts "git config --local --replace-all semaphore.projecttoken \"#{app.git_project_token}\""
110
+ exit 0
117
111
  end
118
112
 
119
- # That's all Folks!
113
+ fail "Coming soon!"
114
+
115
+ # That's all, Folks!
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Semaphore
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.9"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-semaphore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-17 00:00:00.000000000 Z
11
+ date: 2016-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grit
@@ -204,7 +204,6 @@ files:
204
204
  - .gitconform
205
205
  - .gitignore
206
206
  - .irbrc
207
- - .pryrc
208
207
  - .ruby-version
209
208
  - Gemfile
210
209
  - Guardfile
data/.pryrc DELETED
@@ -1,2 +0,0 @@
1
- # this loads all of "git semaphore"
2
- load "bin/git-semaphore" unless Kernel.const_defined? 'Git::Semaphore'