gemfury 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README ADDED
@@ -0,0 +1 @@
1
+ Placeholder - real gem coming soon
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib = File.expand_path('../../lib', __FILE__)
4
+ $LOAD_PATH.unshift(lib) if File.directory?(lib) && !$LOAD_PATH.include?(lib)
5
+
6
+ require 'rubygems'
7
+ require 'gemfury'
8
+ require 'gemfury/command'
9
+
10
+ Gemfury::Command.start
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env ruby
2
+ exec(File.expand_path('../fury', __FILE__), *ARGV)
@@ -0,0 +1,3 @@
1
+ require 'gemfury/const'
2
+ require 'gemfury/platform'
3
+ require 'gemfury/client'
@@ -0,0 +1,27 @@
1
+ require 'multi_json'
2
+ require 'faraday_middleware'
3
+
4
+ module Gemfury
5
+ module Client
6
+ ::Faraday::Request::JSON.adapter = ::MultiJson
7
+
8
+ private
9
+ def client(raw = false)
10
+ options = {
11
+ :url => "http://#{Const.host}",
12
+ :ssl => { :verify => false },
13
+ :headers => {
14
+ 'Accept' => 'application/json',
15
+ 'Content-Type' => 'application/json; charset=utf-8'
16
+ }
17
+ }
18
+
19
+ Faraday.new(options) do |builder|
20
+ builder.use Faraday::Request::JSON
21
+ #builder.use Faraday::Response::Logger
22
+ builder.use Faraday::Response::ParseJson
23
+ builder.adapter :net_http
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,39 @@
1
+ require 'thor'
2
+ require 'launchy'
3
+ require 'highline'
4
+
5
+ module Gemfury
6
+ class Command < Thor
7
+ include Gemfury::Client
8
+
9
+ desc "push GEM" ,"upload a new version of a gem"
10
+ def push(*gems)
11
+ if gems.empty?
12
+ shell.say "Problem: No gems specified", :red
13
+ help(:push)
14
+ return
15
+ end
16
+
17
+ # Collect registration info
18
+ term = HighLine.new
19
+ term.say(Const.welcome)
20
+ email = term.ask("Email: ") do |q|
21
+ q.responses[:not_valid] = Const.email_error
22
+ q.validate = Const.email_regex
23
+ end
24
+
25
+ # Send the registration request
26
+ conn = client # From Gemfury::Client
27
+ resp = conn.post('/invites.json', :invite => { :email => email })
28
+
29
+ # Handle the registration
30
+ if resp.success?
31
+ body = resp.body
32
+ term.say "Thanks! Gemfury is almost ready. Please stay tuned."
33
+ Launchy.open("http://#{Const.host}/invites/#{body['slug']}")
34
+ else
35
+ term.say "Oops! Something went wrong. Please try again", :red
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,26 @@
1
+ module Gemfury
2
+ module Const
3
+ class << self
4
+ def host
5
+ 'www.gemfury.com'
6
+ #'localhost:3000'
7
+ end
8
+
9
+ def welcome
10
+ "Welcome to Gemfury!\nPlease complete the following information"
11
+ end
12
+
13
+ def email_error
14
+ "Invalid email address. Please try again."
15
+ end
16
+
17
+ def email_regex
18
+ return @email_regex if @email_regex
19
+ email_name_regex = '[A-Z0-9_\.%\+\-\']+'
20
+ domain_head_regex = '(?:[A-Z0-9\-]+\.)+'
21
+ domain_tld_regex = '(?:[A-Z]{2,4}|museum|travel)'
22
+ @email_regex = /^#{email_name_regex}@#{domain_head_regex}#{domain_tld_regex}$/i
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,15 @@
1
+ module Gemfury
2
+ module Platform
3
+ def home_directory
4
+ on_windows? ? ENV['USERPROFILE'] : ENV['HOME']
5
+ end
6
+
7
+ def on_windows?
8
+ RUBY_PLATFORM =~ /mswin32|mingw32/
9
+ end
10
+
11
+ def on_mac?
12
+ RUBY_PLATFORM =~ /-darwin\d/
13
+ end
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: gemfury
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 1
10
+ version: 0.1.1
11
+ platform: ruby
12
+ authors:
13
+ - Michael Rykov
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-05-17 00:00:00 -07:00
19
+ default_executable:
20
+ dependencies:
21
+ - !ruby/object:Gem::Dependency
22
+ name: highline
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ hash: 15
30
+ segments:
31
+ - 1
32
+ - 6
33
+ - 0
34
+ version: 1.6.0
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ - !ruby/object:Gem::Dependency
38
+ name: thor
39
+ prerelease: false
40
+ requirement: &id002 !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ~>
44
+ - !ruby/object:Gem::Version
45
+ hash: 45
46
+ segments:
47
+ - 0
48
+ - 14
49
+ - 5
50
+ version: 0.14.5
51
+ type: :runtime
52
+ version_requirements: *id002
53
+ - !ruby/object:Gem::Dependency
54
+ name: launchy
55
+ prerelease: false
56
+ requirement: &id003 !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ~>
60
+ - !ruby/object:Gem::Version
61
+ hash: 15
62
+ segments:
63
+ - 0
64
+ - 4
65
+ - 0
66
+ version: 0.4.0
67
+ type: :runtime
68
+ version_requirements: *id003
69
+ - !ruby/object:Gem::Dependency
70
+ name: multi_json
71
+ prerelease: false
72
+ requirement: &id004 !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ~>
76
+ - !ruby/object:Gem::Version
77
+ hash: 19
78
+ segments:
79
+ - 1
80
+ - 0
81
+ - 2
82
+ version: 1.0.2
83
+ type: :runtime
84
+ version_requirements: *id004
85
+ - !ruby/object:Gem::Dependency
86
+ name: faraday
87
+ prerelease: false
88
+ requirement: &id005 !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ hash: 5
94
+ segments:
95
+ - 0
96
+ - 6
97
+ - 1
98
+ version: 0.6.1
99
+ type: :runtime
100
+ version_requirements: *id005
101
+ - !ruby/object:Gem::Dependency
102
+ name: faraday_middleware
103
+ prerelease: false
104
+ requirement: &id006 !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ~>
108
+ - !ruby/object:Gem::Version
109
+ hash: 1
110
+ segments:
111
+ - 0
112
+ - 6
113
+ - 3
114
+ version: 0.6.3
115
+ type: :runtime
116
+ version_requirements: *id006
117
+ description: |
118
+ Client library and command-line tool to manage your gems on http://gemfury.com
119
+
120
+ email: mrykov@gmail.com
121
+ executables:
122
+ - gemfury
123
+ - fury
124
+ extensions: []
125
+
126
+ extra_rdoc_files: []
127
+
128
+ files:
129
+ - README
130
+ - bin/fury
131
+ - bin/gemfury
132
+ - lib/gemfury/client.rb
133
+ - lib/gemfury/command.rb
134
+ - lib/gemfury/const.rb
135
+ - lib/gemfury/platform.rb
136
+ - lib/gemfury.rb
137
+ has_rdoc: false
138
+ homepage: http://gemfury.com
139
+ licenses: []
140
+
141
+ post_install_message: |
142
+ ************************************************************************
143
+
144
+ Upload your first gem to start using Gemfury:
145
+ fury push my-gem-1.0.gem
146
+
147
+ Follow @gemfury on Twitter for announcements, updates, and news.
148
+ https://twitter.com/gemfury
149
+
150
+ ************************************************************************
151
+
152
+ rdoc_options: []
153
+
154
+ require_paths:
155
+ - lib
156
+ required_ruby_version: !ruby/object:Gem::Requirement
157
+ none: false
158
+ requirements:
159
+ - - ">="
160
+ - !ruby/object:Gem::Version
161
+ hash: 3
162
+ segments:
163
+ - 0
164
+ version: "0"
165
+ required_rubygems_version: !ruby/object:Gem::Requirement
166
+ none: false
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ hash: 3
171
+ segments:
172
+ - 0
173
+ version: "0"
174
+ requirements: []
175
+
176
+ rubyforge_project:
177
+ rubygems_version: 1.6.2
178
+ signing_key:
179
+ specification_version: 3
180
+ summary: Client library and command-line tool to manage your gems on Gemfury
181
+ test_files: []
182
+