git-semaphore 0.0.6 → 0.0.7

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: 273edea665e8a70a50d0e17fd21ee64c118acf43
4
- data.tar.gz: 302770a9c92bcfa7bd0f225e9268604d6c3a44e2
3
+ metadata.gz: 967b795337dc7bf2114afa2409f5f49cfe4d4d5a
4
+ data.tar.gz: dd2b015bad90a68e3d783de7ba2c495c8082ddb0
5
5
  SHA512:
6
- metadata.gz: f0bb582591be6261a260d12def5c0342327707f2bf5e027e5201f9d16e650c91fe97775cf755a9ed12ec56bdbf5946f6b5617b64f30d7138501265956510b692
7
- data.tar.gz: f0cdfbc68247ba305561b0437d63b2ecde37bcf52c7b574fad3196126d1491480f02beb274d00302baaba985215e5a29ba3bccd8efdf3f4733b0f54637db7842
6
+ metadata.gz: 5b3c339ea8d617f7e8826cd24c301baad284836ee495223b61823d8736536c6f0e9487894c8c881cc5470fa0c92b900ddad2aa0e31a4380161dffb9995fbb471
7
+ data.tar.gz: 8e4355613495bf582b7ef3a567ff5b7a2157d925fe58c2fa6f4c540b89f23a66deac144552dc10fdefbe610bb829de52444d51633a209f0e3f24421477b20220
data/.pryrc ADDED
@@ -0,0 +1,2 @@
1
+ # this loads all of "git semaphore"
2
+ load "bin/git-semaphore" unless Kernel.const_defined? 'Git::Semaphore'
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Git::Semaphore
2
2
 
3
- [![Build Status](https://semaphoreapp.com/api/v1/projects/03b2dffc7112138851166c86adb456484426a712/7753/badge.png)](https://semaphoreapp.com/pvdb/git-semaphore)
3
+ [![Build Status](https://semaphoreci.com/api/v1/projects/03b2dffc7112138851166c86adb456484426a712/7753/badge.png)](https://semaphoreci.com/pvdb/git-semaphore)
4
4
 
5
- git integration with [semaphoreapp.com][semaphoreapp.com]
5
+ [![Travis CI](https://travis-ci.org/pvdb/git-semaphore.svg?branch=v0.0.6)](https://travis-ci.org/pvdb/git-semaphore)
6
+
7
+ git integration with [semaphoreci.com][] (via their API)
6
8
 
7
9
  ## Installation
8
10
 
@@ -20,7 +22,7 @@ Or install it yourself as:
20
22
 
21
23
  ## Authentication
22
24
 
23
- Log into [semaphoreapp.com][semaphoreapp.com] and find your API `authentication token` in the `API` tab of one of your projects' `settings` page.
25
+ Log into [semaphoreci.com][] and find your API `authentication token` in the `API` tab of one of your projects' `settings` page.
24
26
 
25
27
  Next, choose one of the following mechanisms to make your API `authentication token` available to `Git::Semaphore`...
26
28
 
@@ -78,5 +80,5 @@ After installing the quite brilliant [jazor gem][jazor] (`gem install jazor`), t
78
80
  4. Push to the branch (`git push origin my-new-feature`)
79
81
  5. Create new Pull Request
80
82
 
81
- [semaphoreapp.com]: https://semaphoreapp.com/
83
+ [semaphoreci.com]: https://semaphoreci.com/
82
84
  [jazor]: https://github.com/mconigliaro/jazor
@@ -1,122 +1,119 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- $LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
-
5
- begin
6
- require 'git-semaphore'
7
- require 'bundler'
8
- Bundler.setup
9
- rescue LoadError
10
- require 'rubygems'
11
- require 'git-semaphore'
12
- end
3
+ $LOAD_PATH.unshift File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
13
4
 
14
- options = Trollop::options do
5
+ require 'git-semaphore'
15
6
 
16
- version Git::Semaphore::COPYRIGHT
17
- banner Git::Semaphore::BANNER
7
+ if __FILE__ == $0
18
8
 
19
- opt :projects, 'List all semaphore.app projects', :short => nil, :default => false
20
- opt :branches, 'List all semaphore.app branches for current project', :short => nil, :default => false
21
- opt :status, 'List the semaphore.app status for the given branch', :short => nil, :default => false
22
- opt :'commit-status', 'Check commit status', :default => false
23
- opt :'rebuild-last-revision', 'Rebuild last revision', :default => false
9
+ options = Trollop::options do
24
10
 
25
- opt :'working-dir', 'Print working dir', :short => 'w', :default => false
26
- opt :'project-name', 'Print project name', :short => 'p', :default => false
27
- opt :'branch-name', 'Print branch name', :short => 'b', :default => false
11
+ version Git::Semaphore::COPYRIGHT
12
+ banner Git::Semaphore::BANNER
28
13
 
29
- opt :'check-auth', 'Check auth token', :short => 'x', :default => false
30
- opt :'check-project', 'Check project hash id', :short => 'y', :default => false
31
- opt :'check-branch', 'Check branch id', :short => 'z', :default => false
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
32
19
 
33
- opt :'git-config', 'Print git settings', :short => 'g', :default => false
34
- opt :'env-config', 'Print environment settings', :short => 'e', :default => false
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
35
23
 
36
- end
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
37
27
 
38
- app = Git::Semaphore::App.new(Dir.pwd, ENV)
28
+ opt :'git-config', 'Print git settings', :short => 'g', :default => false
29
+ opt :'env-config', 'Print environment settings', :short => 'e', :default => false
39
30
 
40
- if !app.validate
41
- r = app.git_repo rescue false
42
- unless r
43
- STDERR.puts "Error: \"#{Dir.pwd}\" is not a git working directory... exiting!"
44
- exit 255
45
31
  end
46
- end
47
32
 
48
- if options[:'rebuild-last-revision']
49
- puts app.rebuild_last_revision
50
- exit 0
51
- end
33
+ app = Git::Semaphore::App.new(Dir.pwd, ENV)
52
34
 
53
- if options[:'commit-status']
54
- puts app.commit_status
55
- exit 0
56
- end
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
57
42
 
58
- if options[:projects]
59
- puts app.projects
60
- exit 0
61
- end
43
+ if options[:'rebuild-last-revision']
44
+ puts app.rebuild_last_revision
45
+ exit 0
46
+ end
62
47
 
63
- if options[:branches]
64
- puts app.branches
65
- exit 0
66
- end
48
+ if options[:'commit-status']
49
+ puts app.commit_status
50
+ exit 0
51
+ end
67
52
 
68
- if options[:status]
69
- puts app.status
70
- exit 0
71
- end
53
+ if options[:projects]
54
+ puts app.projects
55
+ exit 0
56
+ end
72
57
 
73
- if options[:'working-dir']
74
- puts app.working_dir
75
- exit 0
76
- end
58
+ if options[:branches]
59
+ puts app.branches
60
+ exit 0
61
+ end
77
62
 
78
- if options[:'project-name']
79
- puts app.project_name
80
- exit 0
81
- end
63
+ if options[:status]
64
+ puts app.status
65
+ exit 0
66
+ end
82
67
 
83
- if options[:'branch-name']
84
- puts app.branch_name
85
- exit 0
86
- end
68
+ if options[:'working-dir']
69
+ puts app.working_dir
70
+ exit 0
71
+ end
87
72
 
88
- if options[:'check-auth']
89
- unless app.auth_token
90
- STDERR.puts 'Please set - and export - the SEMAPHORE_AUTH_TOKEN env variable'
91
- STDERR.puts 'Alternatively, set semaphore.authtoken in your local git config'
92
- exit -1
93
- else
73
+ if options[:'project-name']
74
+ puts app.project_name
94
75
  exit 0
95
76
  end
96
- end
97
77
 
98
- if options[:'check-project']
99
- unless app.project_token
100
- STDERR.puts 'Please set - and export - the SEMAPHORE_PROJECT_TOKEN env variable'
101
- STDERR.puts 'Alternatively, set semaphore.projecttoken in your local git config'
102
- exit -1
103
- else
78
+ if options[:'branch-name']
79
+ puts app.branch_name
104
80
  exit 0
105
81
  end
106
- end
107
82
 
108
- if options[:'env-config']
109
- puts "export SEMAPHORE_AUTH_TOKEN=\"#{app.env_auth_token}\""
110
- puts "export SEMAPHORE_PROJECT_TOKEN=\"#{app.env_project_token}\""
111
- exit 0
112
- end
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
113
92
 
114
- if options[:'git-config']
115
- puts "git config --local --replace-all semaphore.authtoken \"#{app.git_auth_token}\""
116
- puts "git config --local --replace-all semaphore.projecttoken \"#{app.git_project_token}\""
117
- exit 0
118
- end
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
119
102
 
120
- fail "Coming soon!"
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}\""
106
+ exit 0
107
+ end
108
+
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}\""
112
+ exit 0
113
+ end
114
+
115
+ fail "Coming soon!"
116
+
117
+ end
121
118
 
122
- # That's all, Folks!
119
+ # That's all Folks!
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "branch_name": "gem_updates",
3
- "branch_url": "https://semaphoreapp.com/projects/44/branches/50",
4
- "branch_status_url": "http://semaphoreapp.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9",
5
- "branch_history_url": "http://semaphoreapp.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89?auth_token=Yds3w6o26FLfJTnVK2y9",
3
+ "branch_url": "https://semaphoreci.com/projects/44/branches/50",
4
+ "branch_status_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9",
5
+ "branch_history_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89?auth_token=Yds3w6o26FLfJTnVK2y9",
6
6
  "project_name": "base-app",
7
- "build_url": "https://semaphoreapp.com/projects/44/branches/50/builds/15",
7
+ "build_url": "https://semaphoreci.com/projects/44/branches/50/builds/15",
8
8
  "build_number": 15,
9
9
  "result": "passed",
10
10
  "started_at": "2012-07-09T15:23:53Z",
@@ -17,4 +17,4 @@
17
17
  "message": "Update 'shoulda' gem.",
18
18
  "timestamp": "2012-07-04T18:14:08Z"
19
19
  }
20
- }
20
+ }
@@ -10,8 +10,8 @@
10
10
  {
11
11
  "branch_name": "master",
12
12
  "branch_url": "http://10.0.1.76:3000/projects/61/branches/85",
13
- "branch_status_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
14
- "branch_history_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
13
+ "branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
14
+ "branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
15
15
  "project_name": "testapp-sphinx",
16
16
  "build_url": "http://10.0.1.76:3000/projects/61/branches/85/builds/1",
17
17
  "build_number": 1,
@@ -32,8 +32,8 @@
32
32
  {
33
33
  "branch_name": "mongoid3",
34
34
  "branch_url": "http://10.0.1.76:3000/projects/63/branches/89",
35
- "branch_status_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
36
- "branch_history_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
35
+ "branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
36
+ "branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
37
37
  "project_name": "testapp-mongodb",
38
38
  "build_url": "http://10.0.1.76:3000/projects/63/branches/89/builds/3",
39
39
  "build_number": 3,
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://semaphoreapp.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/branches?auth_token=Yds3w6o26FLfJTnVK2y9
5
+ uri: https://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/branches?auth_token=Yds3w6o26FLfJTnVK2y9
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://semaphoreapp.com/api/v1/projects?auth_token=Yds3w6o26FLfJTnVK2y9
5
+ uri: https://semaphoreci.com/api/v1/projects?auth_token=Yds3w6o26FLfJTnVK2y9
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -63,8 +63,8 @@ http_interactions:
63
63
  {
64
64
  "branch_name": "master",
65
65
  "branch_url": "http://10.0.1.76:3000/projects/61/branches/85",
66
- "branch_status_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
67
- "branch_history_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
66
+ "branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
67
+ "branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
68
68
  "project_name": "testapp-sphinx",
69
69
  "build_url": "http://10.0.1.76:3000/projects/61/branches/85/builds/1",
70
70
  "build_number": 1,
@@ -85,8 +85,8 @@ http_interactions:
85
85
  {
86
86
  "branch_name": "mongoid3",
87
87
  "branch_url": "http://10.0.1.76:3000/projects/63/branches/89",
88
- "branch_status_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
89
- "branch_history_url": "http://semaphoreapp.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
88
+ "branch_status_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85/status?auth_token=Yds3w6o26FLfJTnVK2y9",
89
+ "branch_history_url": "http://semaphoreci.com/api/v1/projects/3f1004b8343faabda63d441734526c854380ab89/85?auth_token=Yds3w6o26FLfJTnVK2y9",
90
90
  "project_name": "testapp-mongodb",
91
91
  "build_url": "http://10.0.1.76:3000/projects/63/branches/89/builds/3",
92
92
  "build_number": 3,
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://semaphoreapp.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/build?auth_token=Yds3w6o26FLfJTnVK2y9
5
+ uri: https://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/build?auth_token=Yds3w6o26FLfJTnVK2y9
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: auth_token=Yds3w6o26FLfJTnVK2y9
@@ -49,7 +49,7 @@ http_interactions:
49
49
  - nginx/1.2.2 + Phusion Passenger 3.0.14 (mod_rails/mod_rack)
50
50
  body:
51
51
  encoding: UTF-8
52
- string: ! '{"commits":[{"id":"dummy_commit","url":"https://github.com/company/dummy_project/commit/dummy_commit","author_name":"Dude","author_email":"dude@company.co.uk","message":"Spiky spike","timestamp":"2014-07-23T09:52:55Z"},{"id":"foobar","url":"https://github.com/company/dummy_project/commit/foobar","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-25T15:33:05Z"},{"id":"dummy_commit4","url":"https://github.com/company/dummy_project/commit/dummy_commit4","author_name":"Dude","author_email":"dude@company.co.uk","message":"Move letter-opener to production gem","timestamp":"2014-07-28T07:32:28Z"},{"id":"dummy_commit2","url":"https://github.com/company/dummy_project/commit/dummy_commit2","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-30T07:25:37Z"},{"id":"dummy_commit3","url":"https://github.com/company/dummy_project/commit/dummy_commit3","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-08-04T10:08:26Z"},{"id":"dummy_commit5","url":"https://github.com/company/dummy_project/commit/dummy_commit5","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch\n\nConflicts:\n\tGemfile","timestamp":"2014-12-18T09:05:53Z"}],"project_name":"dummy_project","branch_name":"dumy-branch","number":4,"result":null,"created_at":"2014-12-18T09:44:11Z","updated_at":"2014-12-18T09:44:11Z","started_at":null,"finished_at":null,"html_url":"https://semaphoreapp.com/company/dummy_project/branches/dumy-branch/builds/4","build_log_url":"https://semaphoreapp.com/api/v1/projects/dummy_project/313010/builds/4/log?auth_token=Yds3w6o26FLfJTnVK2y9","build_info_url":"https://semaphoreapp.com/api/v1/projects/dummy_project/313010/builds/4?auth_token=Yds3w6o26FLfJTnVK2y9"}'
52
+ string: ! '{"commits":[{"id":"dummy_commit","url":"https://github.com/company/dummy_project/commit/dummy_commit","author_name":"Dude","author_email":"dude@company.co.uk","message":"Spiky spike","timestamp":"2014-07-23T09:52:55Z"},{"id":"foobar","url":"https://github.com/company/dummy_project/commit/foobar","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-25T15:33:05Z"},{"id":"dummy_commit4","url":"https://github.com/company/dummy_project/commit/dummy_commit4","author_name":"Dude","author_email":"dude@company.co.uk","message":"Move letter-opener to production gem","timestamp":"2014-07-28T07:32:28Z"},{"id":"dummy_commit2","url":"https://github.com/company/dummy_project/commit/dummy_commit2","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-07-30T07:25:37Z"},{"id":"dummy_commit3","url":"https://github.com/company/dummy_project/commit/dummy_commit3","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch","timestamp":"2014-08-04T10:08:26Z"},{"id":"dummy_commit5","url":"https://github.com/company/dummy_project/commit/dummy_commit5","author_name":"Dude","author_email":"dude@company.co.uk","message":"Merge branch \"master\" into dumy-branch\n\nConflicts:\n\tGemfile","timestamp":"2014-12-18T09:05:53Z"}],"project_name":"dummy_project","branch_name":"dumy-branch","number":4,"result":null,"created_at":"2014-12-18T09:44:11Z","updated_at":"2014-12-18T09:44:11Z","started_at":null,"finished_at":null,"html_url":"https://semaphoreci.com/company/dummy_project/branches/dumy-branch/builds/4","build_log_url":"https://semaphoreci.com/api/v1/projects/dummy_project/313010/builds/4/log?auth_token=Yds3w6o26FLfJTnVK2y9","build_info_url":"https://semaphoreci.com/api/v1/projects/dummy_project/313010/builds/4?auth_token=Yds3w6o26FLfJTnVK2y9"}'
53
53
  http_version:
54
54
  recorded_at: Thu, 18 Dec 2014 09:38:06 GMT
55
55
  recorded_with: VCR 2.9.3
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://semaphoreapp.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9
5
+ uri: https://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -53,11 +53,11 @@ http_interactions:
53
53
  encoding: US-ASCII
54
54
  string: ! '{
55
55
  "branch_name": "gem_updates",
56
- "branch_url": "https://semaphoreapp.com/projects/44/branches/50",
57
- "branch_status_url": "http://semaphoreapp.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9",
58
- "branch_history_url": "http://semaphoreapp.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89?auth_token=Yds3w6o26FLfJTnVK2y9",
56
+ "branch_url": "https://semaphoreci.com/projects/44/branches/50",
57
+ "branch_status_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89/status?auth_token=Yds3w6o26FLfJTnVK2y9",
58
+ "branch_history_url": "http://semaphoreci.com/api/v1/projects/649e584dc507ca4b73e1374d3125ef0b567a949c/89?auth_token=Yds3w6o26FLfJTnVK2y9",
59
59
  "project_name": "base-app",
60
- "build_url": "https://semaphoreapp.com/projects/44/branches/50/builds/15",
60
+ "build_url": "https://semaphoreci.com/projects/44/branches/50/builds/15",
61
61
  "build_number": 15,
62
62
  "result": "passed",
63
63
  "started_at": "2012-07-09T15:23:53Z",
@@ -8,21 +8,21 @@ Feature: Help Me I've Got Versionitis
8
8
  And the banner should include the version
9
9
  And the banner should document that this app takes options
10
10
  And the following trollop options should be documented:
11
- | --version, -v: |
12
- | --help, -h: |
13
- | --working-dir, -w: |
14
- | --project-name, -p: |
15
- | --branch-name, -b: |
16
- | --check-auth, -x: |
17
- | --check-project, -y: |
18
- | --check-branch, -z: |
19
- | --env-config, -e: |
20
- | --git-config, -g: |
21
- | --projects, -r: |
22
- | --branches, -a: |
23
- | --status, -s: |
24
- | --commit-status, -c: |
25
- | --rebuild-last-revision, -u: |
11
+ | -v, --version |
12
+ | -h, --help |
13
+ | -w, --working-dir |
14
+ | -p, --project-name |
15
+ | -b, --branch-name |
16
+ | -x, --check-auth |
17
+ | -y, --check-project |
18
+ | -z, --check-branch |
19
+ | -e, --env-config |
20
+ | -g, --git-config |
21
+ | -r, --projects |
22
+ | -a, --branches |
23
+ | -s, --status |
24
+ | -c, --commit-status |
25
+ | -u, --rebuild-last-revision |
26
26
 
27
27
  Scenario: get the version of the main script
28
28
 
@@ -3,27 +3,27 @@ Feature: Show Me What You've Got
3
3
  @vcr_api_projects
4
4
  Scenario: user's projects
5
5
 
6
- Given I am an authenticated user on semaphoreapp.com
6
+ Given I am an authenticated user on semaphoreci.com
7
7
  And get the list of all my projects via their API
8
8
  Then the JSON should be an array
9
9
 
10
10
  @vcr_api_branches
11
11
  Scenario: project's branches
12
12
 
13
- Given I am an authenticated user on semaphoreapp.com
13
+ Given I am an authenticated user on semaphoreci.com
14
14
  And get the list of all the branches for one of my projects via their API
15
15
  Then the JSON should be an array
16
16
 
17
17
  @vcr_api_status
18
18
  Scenario: branch status
19
19
 
20
- Given I am an authenticated user on semaphoreapp.com
20
+ Given I am an authenticated user on semaphoreci.com
21
21
  And get the build status of one of the branches for one of my projects via their API
22
22
  Then the JSON should be a hash
23
23
 
24
24
  @vcr_api_rebuild_last_revision
25
25
  Scenario: Rebuild last revision
26
26
 
27
- Given I am an authenticated user on semaphoreapp.com
27
+ Given I am an authenticated user on semaphoreci.com
28
28
  And request to rebuild the last revision of one of the branches for one of my projects via their API
29
29
  Then the JSON should be a hash
@@ -1,10 +1,10 @@
1
1
  #
2
- # Steps that interact with ENV
2
+ # Steps that interact with ENV (via `aruba.environment`)
3
3
  #
4
4
 
5
5
  Before do
6
- set_env('SEMAPHORE_AUTH_TOKEN', nil)
7
- set_env('SEMAPHORE_PROJECT_TOKEN', nil)
6
+ set_environment_variable('SEMAPHORE_AUTH_TOKEN', nil)
7
+ set_environment_variable('SEMAPHORE_PROJECT_TOKEN', nil)
8
8
  end
9
9
 
10
10
  After do
@@ -12,16 +12,16 @@ After do
12
12
  end
13
13
 
14
14
  Given /^the "([A-Z_]+)" env variable is set(?: to "([^"]*)")?$/ do |key, value|
15
- set_env(key, value || 'blegga')
15
+ set_environment_variable(key, value || 'blegga')
16
16
  end
17
17
 
18
18
  Given /^the "([A-Z_]+)" env variable is not set$/ do |key|
19
- set_env(key, nil)
19
+ set_environment_variable(key, nil)
20
20
  end
21
21
 
22
22
  Given /^a runtime environment with config:$/ do |config_table|
23
23
  config_table.rows_hash.each do |key, value|
24
- set_env(key, value)
24
+ set_environment_variable(key, value)
25
25
  end
26
26
  end
27
27
 
@@ -30,7 +30,7 @@ end
30
30
  #
31
31
 
32
32
  Given /^a git repo in directory "([^"]*)"$/ do |project_name|
33
- @pwd = File.join(current_dir, project_name)
33
+ @pwd = File.join(expand_path('.'), project_name)
34
34
  @repo = Grit::Repo.init(@pwd)
35
35
  end
36
36
 
@@ -81,7 +81,7 @@ Then /^the output should include the app name$/ do
81
81
  end
82
82
 
83
83
  Then /^the output should include a copyright notice$/ do
84
- step %(the output should match /Copyright \\(c\\) [\\d]{4} [[\\w]+]+/)
84
+ step %(the output should match /Copyright \\(c\\) [\\d]{4}-[\\d]{4} [[\\w]+]+/)
85
85
  end
86
86
 
87
87
  #
@@ -89,33 +89,33 @@ end
89
89
  #
90
90
 
91
91
  # Then /^the application uses "([^"]+)" as the git auth token$/ do |auth_token|
92
- # (@app || Git::Semaphore::App.new(@repo, ENV)).git_auth_token.should eq auth_token
92
+ # (@app || Git::Semaphore::App.new(@repo, aruba.environment)).git_auth_token.should eq auth_token
93
93
  # end
94
94
 
95
95
  # Then /^the application uses "([^"]+)" as the git project token$/ do |project_token|
96
- # (@app || Git::Semaphore::App.new(@repo, ENV)).git_project_token.should eq project_token
96
+ # (@app || Git::Semaphore::App.new(@repo, aruba.environment)).git_project_token.should eq project_token
97
97
  # end
98
98
 
99
99
  # Then /^the application uses "([^"]+)" as the env auth token$/ do |auth_token|
100
- # (@app || Git::Semaphore::App.new(@repo, ENV)).env_auth_token.should eq auth_token
100
+ # (@app || Git::Semaphore::App.new(@repo, aruba.environment)).env_auth_token.should eq auth_token
101
101
  # end
102
102
 
103
103
  # Then /^the application uses "([^"]+)" as the env project token$/ do |project_token|
104
- # (@app || Git::Semaphore::App.new(@repo, ENV)).env_project_token.should eq project_token
104
+ # (@app || Git::Semaphore::App.new(@repo, aruba.environment)).env_project_token.should eq project_token
105
105
  # end
106
106
 
107
107
  Then /^the application doesn't have an auth token$/ do
108
- (@app || Git::Semaphore::App.new(@pwd, ENV)).auth_token.should be_nil
108
+ (@app || Git::Semaphore::App.new(@pwd, aruba.environment)).auth_token.should be_empty
109
109
  end
110
110
 
111
111
  Then /^the application doesn't have a project token$/ do
112
- (@app || Git::Semaphore::App.new(@pwd, ENV)).project_token.should be_nil
112
+ (@app || Git::Semaphore::App.new(@pwd, aruba.environment)).project_token.should be_empty
113
113
  end
114
114
 
115
115
  Then /^the application uses "([^"]+)" as the auth token$/ do |auth_token|
116
- (@app || Git::Semaphore::App.new(@pwd, ENV)).auth_token.should eq auth_token
116
+ (@app || Git::Semaphore::App.new(@pwd, aruba.environment)).auth_token.should eq auth_token
117
117
  end
118
118
 
119
119
  Then /^the application uses "([^"]+)" as the project token$/ do |project_token|
120
- (@app || Git::Semaphore::App.new(@pwd, ENV)).project_token.should eq project_token
120
+ (@app || Git::Semaphore::App.new(@pwd, aruba.environment)).project_token.should eq project_token
121
121
  end
@@ -1,4 +1,4 @@
1
- Given /^I am an authenticated user on semaphoreapp\.com$/ do
1
+ Given /^I am an authenticated user on semaphoreci\.com$/ do
2
2
  @auth_token = SEMAPHORE_TEST_TOKEN
3
3
  @project = '649e584dc507ca4b73e1374d3125ef0b567a949c'
4
4
  @branch = '89'
@@ -4,5 +4,4 @@ require 'git-semaphore'
4
4
 
5
5
  require 'aruba/cucumber'
6
6
  require 'methadone/cucumber'
7
- require 'cucumber-pride'
8
7
  require "json_spec/cucumber"
@@ -1,2 +1,2 @@
1
- # http://docs.semaphoreapp.com/api
2
- SEMAPHORE_TEST_TOKEN='Yds3w6o26FLfJTnVK2y9'
1
+ # https://semaphoreci.com/docs/
2
+ SEMAPHORE_TEST_TOKEN='Yds3w6o26FLfJTnVK2y9'
@@ -1,40 +1,35 @@
1
- # -*- encoding: utf-8 -*-
1
+ # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
  require 'git-semaphore/version'
5
5
 
6
- Gem::Specification.new do |gem|
7
- gem.name = "git-semaphore"
8
- gem.version = Git::Semaphore::VERSION
9
- gem.authors = ["Peter Vandenberk"]
10
- gem.email = ["pvandenberk@mac.com"]
11
- gem.description = ["git integration with https://semaphoreapp.com"]
12
- gem.summary = ["git integration with https://semaphoreapp.com"]
13
- gem.homepage = "https://github.com/pvdb/git-semaphore"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "git-semaphore"
8
+ spec.version = Git::Semaphore::VERSION
9
+ spec.authors = ["Peter Vandenberk"]
10
+ spec.email = ["pvandenberk@mac.com"]
11
+ spec.summary = ["git integration with https://semaphoreci.com"]
12
+ spec.description = ["git integration with https://semaphoreci.com"]
13
+ spec.homepage = "https://github.com/pvdb/git-semaphore"
14
+ spec.license = "MIT"
14
15
 
15
- gem.files = `git ls-files`.split($/)
16
- gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
17
- gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
- gem.require_paths = ["lib"]
16
+ spec.files = `git ls-files`.split($/)
17
+ spec.executables = spec.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
18
+ spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
19
+ spec.require_paths = ["lib"]
19
20
 
20
- gem.add_dependency('grit')
21
- gem.add_dependency('trollop')
21
+ spec.add_dependency('grit')
22
+ spec.add_dependency('trollop')
22
23
 
23
- gem.add_development_dependency('pry')
24
- gem.add_development_dependency('rake')
25
- gem.add_development_dependency('awesome_print')
26
- gem.add_development_dependency('cucumber')
27
- gem.add_development_dependency('rspec')
28
- gem.add_development_dependency('aruba')
29
- gem.add_development_dependency('methadone')
30
- gem.add_development_dependency('guard-rspec')
31
- gem.add_development_dependency('guard-cucumber')
32
- gem.add_development_dependency('rb-fsevent')
33
- gem.add_development_dependency('growl')
34
- gem.add_development_dependency('rspec-pride')
35
- gem.add_development_dependency('cucumber-pride')
36
- gem.add_development_dependency('vcr')
37
- gem.add_development_dependency('webmock')
38
- gem.add_development_dependency('jazor')
39
- gem.add_development_dependency('json_spec')
24
+ spec.add_development_dependency('pry')
25
+ spec.add_development_dependency('rake')
26
+ spec.add_development_dependency('bundler')
27
+ spec.add_development_dependency('cucumber')
28
+ spec.add_development_dependency('rspec')
29
+ spec.add_development_dependency('aruba')
30
+ spec.add_development_dependency('methadone')
31
+ spec.add_development_dependency('vcr')
32
+ spec.add_development_dependency('webmock')
33
+ spec.add_development_dependency('jazor')
34
+ spec.add_development_dependency('json_spec')
40
35
  end
@@ -1,5 +1,3 @@
1
- require 'rubygems'
2
-
3
1
  require 'grit'
4
2
  require 'trollop'
5
3
 
@@ -6,9 +6,9 @@ module Git
6
6
  module Semaphore
7
7
  class Api
8
8
 
9
- # http://docs.semaphoreapp.com/api
9
+ # https://semaphoreci.com/docs/
10
10
 
11
- SEMAPHORE_API_HOST = 'semaphoreapp.com'
11
+ SEMAPHORE_API_HOST = 'semaphoreci.com'
12
12
  SEMAPHORE_API_URI = '/api/v1'
13
13
 
14
14
  def self.projects_uri auth_token
@@ -1,6 +1,6 @@
1
1
  module Git
2
2
  module Semaphore
3
3
  # TODO replace hard-coded details with data retrieved from the gemspec
4
- COPYRIGHT = "git-semaphore v#{Git::Semaphore::VERSION} Copyright (c) 2012 Peter Vandenberk"
4
+ COPYRIGHT = "git-semaphore v#{Git::Semaphore::VERSION} Copyright (c) 2012-2015 Peter Vandenberk"
5
5
  end
6
6
  end
@@ -1,5 +1,5 @@
1
1
  module Git
2
2
  module Semaphore
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
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.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Vandenberk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2016-02-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: grit
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: awesome_print
70
+ name: bundler
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '>='
@@ -136,90 +136,6 @@ dependencies:
136
136
  - - '>='
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
- - !ruby/object:Gem::Dependency
140
- name: guard-rspec
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - '>='
144
- - !ruby/object:Gem::Version
145
- version: '0'
146
- type: :development
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - '>='
151
- - !ruby/object:Gem::Version
152
- version: '0'
153
- - !ruby/object:Gem::Dependency
154
- name: guard-cucumber
155
- requirement: !ruby/object:Gem::Requirement
156
- requirements:
157
- - - '>='
158
- - !ruby/object:Gem::Version
159
- version: '0'
160
- type: :development
161
- prerelease: false
162
- version_requirements: !ruby/object:Gem::Requirement
163
- requirements:
164
- - - '>='
165
- - !ruby/object:Gem::Version
166
- version: '0'
167
- - !ruby/object:Gem::Dependency
168
- name: rb-fsevent
169
- requirement: !ruby/object:Gem::Requirement
170
- requirements:
171
- - - '>='
172
- - !ruby/object:Gem::Version
173
- version: '0'
174
- type: :development
175
- prerelease: false
176
- version_requirements: !ruby/object:Gem::Requirement
177
- requirements:
178
- - - '>='
179
- - !ruby/object:Gem::Version
180
- version: '0'
181
- - !ruby/object:Gem::Dependency
182
- name: growl
183
- requirement: !ruby/object:Gem::Requirement
184
- requirements:
185
- - - '>='
186
- - !ruby/object:Gem::Version
187
- version: '0'
188
- type: :development
189
- prerelease: false
190
- version_requirements: !ruby/object:Gem::Requirement
191
- requirements:
192
- - - '>='
193
- - !ruby/object:Gem::Version
194
- version: '0'
195
- - !ruby/object:Gem::Dependency
196
- name: rspec-pride
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - '>='
200
- - !ruby/object:Gem::Version
201
- version: '0'
202
- type: :development
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - '>='
207
- - !ruby/object:Gem::Version
208
- version: '0'
209
- - !ruby/object:Gem::Dependency
210
- name: cucumber-pride
211
- requirement: !ruby/object:Gem::Requirement
212
- requirements:
213
- - - '>='
214
- - !ruby/object:Gem::Version
215
- version: '0'
216
- type: :development
217
- prerelease: false
218
- version_requirements: !ruby/object:Gem::Requirement
219
- requirements:
220
- - - '>='
221
- - !ruby/object:Gem::Version
222
- version: '0'
223
139
  - !ruby/object:Gem::Dependency
224
140
  name: vcr
225
141
  requirement: !ruby/object:Gem::Requirement
@@ -276,7 +192,7 @@ dependencies:
276
192
  - - '>='
277
193
  - !ruby/object:Gem::Version
278
194
  version: '0'
279
- description: '["git integration with https://semaphoreapp.com"]'
195
+ description: '["git integration with https://semaphoreci.com"]'
280
196
  email:
281
197
  - pvandenberk@mac.com
282
198
  executables:
@@ -288,6 +204,7 @@ files:
288
204
  - .gitconform
289
205
  - .gitignore
290
206
  - .irbrc
207
+ - .pryrc
291
208
  - .ruby-version
292
209
  - Gemfile
293
210
  - Guardfile
@@ -327,7 +244,8 @@ files:
327
244
  - spec_helper.rb
328
245
  - vendor/bundle/.gitignore
329
246
  homepage: https://github.com/pvdb/git-semaphore
330
- licenses: []
247
+ licenses:
248
+ - MIT
331
249
  metadata: {}
332
250
  post_install_message:
333
251
  rdoc_options: []
@@ -345,10 +263,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
345
263
  version: '0'
346
264
  requirements: []
347
265
  rubyforge_project:
348
- rubygems_version: 2.0.14
266
+ rubygems_version: 2.4.8
349
267
  signing_key:
350
268
  specification_version: 4
351
- summary: '["git integration with https://semaphoreapp.com"]'
269
+ summary: '["git integration with https://semaphoreci.com"]'
352
270
  test_files:
353
271
  - features/cassettes/cucumber_tags/api_branch_status.json
354
272
  - features/cassettes/cucumber_tags/api_project_branches.json