Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Commit 44adcbe

Browse files
committed
convert github-services to a gem
1 parent 5ff04a6 commit 44adcbe

File tree

8 files changed

+104
-71
lines changed

8 files changed

+104
-71
lines changed

Gemfile

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,4 @@
11
source "http://rubygems.org"
22

3-
gem "activeresource", "~> 3.0.0"
4-
gem "addressable", "~> 2.2.7"
5-
gem "amqp", "0.6.7", :require => 'mq'
6-
gem "httparty", "0.7.4"
7-
gem 'yajl-ruby', '1.1.0', :require => 'yajl/json_gem'
8-
gem "mash", "~> 0.1.1"
9-
gem "mime-types", "~> 1.15", :require => 'mime/types'
10-
gem "oauth", "0.4.4"
11-
gem "sinatra", "~> 1.2.6"
12-
gem "tilt", "~> 1.2.1"
13-
gem "tinder", "1.8.0.github"
14-
gem "mail", "~>2.3"
15-
gem "xml-simple", "1.0.11", :require => 'xmlsimple'
16-
gem "xmpp4r-simple", "0.8.8"
17-
#gem "yammer4r", "0.1.5"
18-
gem "ruby-hmac", "0.4.0"
19-
gem "thin", "1.2.2"
20-
gem "faraday", "0.7.6"
3+
gemspec
214
gem "rake", "0.8.7"
22-
gem "SystemTimer", :platforms => :ruby_18
23-
gem "statsd-ruby", "0.3.0.github.1"
24-
gem "twilio-ruby", "3.4.2"
25-
gem "rack-test", :require => false
26-
gem "right_aws", "3.0.3"
27-
gem "right_http_connection", "1.3.0"
28-
gem "mqtt", "0.0.8"
29-
gem "softlayer_messaging", "~> 1.0.2"
30-
gem "aws-sdk", "~> 1.8.0"
31-
gem "unicorn", "~> 4.5.0"

Gemfile.lock

Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
PATH
2+
remote: .
3+
specs:
4+
github-services (1.0.0.5ff04a6)
5+
SystemTimer
6+
activeresource (~> 3.0.0)
7+
addressable (~> 2.2.7)
8+
amqp (= 0.6.7)
9+
aws-sdk (~> 1.8.0)
10+
faraday (= 0.7.6)
11+
httparty (= 0.7.4)
12+
mail (~> 2.3)
13+
mash (~> 0.1.1)
14+
mime-types (~> 1.15)
15+
mqtt (= 0.0.8)
16+
oauth (= 0.4.4)
17+
right_aws (= 3.0.3)
18+
right_http_connection (= 1.3.0)
19+
ruby-hmac (= 0.4.0)
20+
softlayer_messaging (~> 1.0.2)
21+
statsd-ruby (= 0.3.0.github.1)
22+
tilt (~> 1.2.1)
23+
tinder (= 1.8.0.github)
24+
twilio-ruby (= 3.4.2)
25+
xml-simple (= 1.0.11)
26+
xmpp4r-simple (= 0.8.8)
27+
yajl-ruby (= 1.1.0)
28+
129
GEM
230
remote: http://rubygems.org/
331
specs:
@@ -10,7 +38,7 @@ GEM
1038
activemodel (= 3.0.10)
1139
activesupport (= 3.0.10)
1240
activesupport (3.0.10)
13-
addressable (2.2.7)
41+
addressable (2.2.8)
1442
amqp (0.6.7)
1543
eventmachine (>= 0.12.4)
1644
aws-sdk (1.8.1.1)
@@ -19,7 +47,6 @@ GEM
1947
uuidtools (~> 2.1)
2048
builder (2.1.2)
2149
crack (0.1.8)
22-
daemons (1.1.0)
2350
eventmachine (0.12.10)
2451
faraday (0.7.6)
2552
addressable (~> 2.2)
@@ -35,7 +62,6 @@ GEM
3562
json (1.6.6)
3663
jwt (0.1.3)
3764
json (>= 1.2.4)
38-
kgio (2.7.4)
3965
mail (2.3.0)
4066
i18n (>= 0.4.0)
4167
mime-types (~> 1.16)
@@ -44,14 +70,13 @@ GEM
4470
mime-types (1.18)
4571
mqtt (0.0.8)
4672
multi_json (1.3.2)
47-
multipart-post (1.1.3)
73+
multipart-post (1.1.5)
4874
nokogiri (1.5.6)
4975
oauth (0.4.4)
5076
polyglot (0.3.3)
5177
rack (1.4.1)
5278
rack-test (0.6.1)
5379
rack (>= 1.0)
54-
raindrops (0.10.0)
5580
rake (0.8.7)
5681
rest-client (1.6.7)
5782
mime-types (>= 1.16)
@@ -60,16 +85,9 @@ GEM
6085
right_http_connection (1.3.0)
6186
ruby-hmac (0.4.0)
6287
simple_oauth (0.1.5)
63-
sinatra (1.2.6)
64-
rack (~> 1.1)
65-
tilt (>= 1.2.2, < 2.0)
6688
softlayer_messaging (1.0.2)
6789
rest-client
6890
statsd-ruby (0.3.0.github.1)
69-
thin (1.2.2)
70-
daemons (>= 1.0.9)
71-
eventmachine (>= 0.12.6)
72-
rack (>= 1.0.0)
7391
tilt (1.2.2)
7492
tinder (1.8.0.github)
7593
activesupport (>= 2.3, < 4)
@@ -93,10 +111,6 @@ GEM
93111
eventmachine (>= 0.12.8)
94112
http_parser.rb (~> 0.5.1)
95113
simple_oauth (~> 0.1.4)
96-
unicorn (4.5.0)
97-
kgio (~> 2.6)
98-
rack
99-
raindrops (~> 0.7)
100114
uuidtools (2.1.3)
101115
xml-simple (1.0.11)
102116
xmpp4r (0.5)
@@ -108,31 +122,6 @@ PLATFORMS
108122
ruby
109123

110124
DEPENDENCIES
111-
SystemTimer
112-
activeresource (~> 3.0.0)
113-
addressable (~> 2.2.7)
114-
amqp (= 0.6.7)
115-
aws-sdk (~> 1.8.0)
116-
faraday (= 0.7.6)
117-
httparty (= 0.7.4)
118-
mail (~> 2.3)
119-
mash (~> 0.1.1)
120-
mime-types (~> 1.15)
121-
mqtt (= 0.0.8)
122-
oauth (= 0.4.4)
125+
github-services!
123126
rack-test
124127
rake (= 0.8.7)
125-
right_aws (= 3.0.3)
126-
right_http_connection (= 1.3.0)
127-
ruby-hmac (= 0.4.0)
128-
sinatra (~> 1.2.6)
129-
softlayer_messaging (~> 1.0.2)
130-
statsd-ruby (= 0.3.0.github.1)
131-
thin (= 1.2.2)
132-
tilt (~> 1.2.1)
133-
tinder (= 1.8.0.github)
134-
twilio-ruby (= 3.4.2)
135-
unicorn (~> 4.5.0)
136-
xml-simple (= 1.0.11)
137-
xmpp4r-simple (= 0.8.8)
138-
yajl-ruby (= 1.1.0)

github-services.gemspec

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
lib = "github-services"
2+
lib_file = File.expand_path("../lib/#{lib}.rb", __FILE__)
3+
File.read(lib_file) =~ /\bVERSION\s*=\s*["'](.+?)["']/
4+
version = $1
5+
sha = `git rev-parse HEAD 2>/dev/null || echo unknown`
6+
sha.chomp!
7+
version << ".#{sha[0,7]}"
8+
9+
Gem::Specification.new do |spec|
10+
spec.specification_version = 2 if spec.respond_to? :specification_version=
11+
spec.required_rubygems_version = Gem::Requirement.new(">= 1.3.5") if spec.respond_to? :required_rubygems_version=
12+
13+
spec.name = lib
14+
spec.version = version
15+
16+
spec.summary = "GitHub Services client code"
17+
18+
spec.authors = ["Rick Olson"]
19+
spec.email = 'rick@github.com'
20+
spec.homepage = 'https://github.com/github/github-services'
21+
spec.licenses = ['MIT']
22+
23+
spec.add_dependency "activeresource", "~> 3.0.0"
24+
spec.add_dependency "addressable", "~> 2.2.7"
25+
spec.add_dependency "amqp", "0.6.7"
26+
spec.add_dependency "httparty", "0.7.4"
27+
spec.add_dependency 'yajl-ruby', '1.1.0'
28+
spec.add_dependency "mash", "~> 0.1.1"
29+
spec.add_dependency "mime-types", "~> 1.15"
30+
spec.add_dependency "oauth", "0.4.4"
31+
spec.add_dependency "tilt", "~> 1.2.1"
32+
spec.add_dependency "tinder", "1.8.0.github"
33+
spec.add_dependency "mail", "~>2.3"
34+
spec.add_dependency "xml-simple", "1.0.11"
35+
spec.add_dependency "xmpp4r-simple", "0.8.8"
36+
#gem "yammer4r", "0.1.5"
37+
spec.add_dependency "ruby-hmac", "0.4.0"
38+
spec.add_dependency "faraday", "0.7.6"
39+
spec.add_dependency "SystemTimer"
40+
spec.add_dependency "statsd-ruby", "0.3.0.github.1"
41+
spec.add_dependency "twilio-ruby", "3.4.2"
42+
spec.add_dependency "right_aws", "3.0.3"
43+
spec.add_dependency "right_http_connection", "1.3.0"
44+
spec.add_dependency "mqtt", "0.0.8"
45+
spec.add_dependency "softlayer_messaging", "~> 1.0.2"
46+
spec.add_dependency "aws-sdk", "~> 1.8.0"
47+
spec.add_development_dependency "rack-test"
48+
49+
spec.files = %w(Gemfile LICENSE README.mkdn CONTRIBUTING.md Rakefile)
50+
spec.files << "#{lib}.gemspec"
51+
spec.files += Dir.glob("lib/**/*.rb")
52+
spec.files += Dir.glob("test/**/*.rb")
53+
spec.files += Dir.glob("script/*")
54+
55+
dev_null = File.exist?('/dev/null') ? '/dev/null' : 'NUL'
56+
git_files = `git ls-files -z 2>#{dev_null}`
57+
spec.files &= git_files.split("\0") if $?.success?
58+
end

lib/github-services.rb

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
require 'xmlsimple'
1515
require 'active_resource'
1616
require 'rack'
17-
require 'sinatra/base'
1817
require 'tinder'
1918
require 'yajl/json_gem'
2019
require 'basecamp'
@@ -65,4 +64,18 @@ def Connection.URI(url)
6564
end
6665
end
6766

67+
module GitHubServices
68+
VERSION = '1.0.0'
69+
70+
# The SHA1 of the commit that was HEAD when the process started. This is
71+
# used in production to determine which version of the app is deployed.
72+
#
73+
# Returns the 40 char commit SHA1 string.
74+
def self.current_sha
75+
@current_sha ||=
76+
`cd #{root}; git rev-parse HEAD 2>/dev/null || echo unknown`.
77+
chomp.freeze
78+
end
79+
end
80+
6881
require File.expand_path('../service', __FILE__)

vendor/cache/addressable-2.2.7.gem

-96.5 KB
Binary file not shown.

vendor/cache/addressable-2.2.8.gem

97 KB
Binary file not shown.
-8.5 KB
Binary file not shown.
9.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)