spade 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- spade (0.0.3)
4
+ spade (0.0.5)
5
5
  eventmachine (~> 0.12.10)
6
6
  gemcutter (~> 0.6.1)
7
7
  highline (~> 1.6.1)
data/lib/spade/remote.rb CHANGED
@@ -2,11 +2,11 @@ require 'spade/dependency_installer'
2
2
 
3
3
  module Spade
4
4
  class Remote < Repository
5
- extend Gem::GemcutterUtilities
5
+ include Gem::UserInteraction
6
6
 
7
7
  def login(email, password)
8
- response = self.class.rubygems_api_request :get, "api/v1/api_key" do |request|
9
- request.basic_auth email, password
8
+ response = raw_request :get, "api/v1/api_key" do |req|
9
+ req.basic_auth email, password
10
10
  end
11
11
 
12
12
  case response
@@ -81,10 +81,18 @@ module Spade
81
81
 
82
82
  private
83
83
 
84
- def request(method, path)
85
- response = self.class.rubygems_api_request method, path do |req|
86
- yield req
87
- end
84
+ def raw_request(method, path, &block)
85
+ require 'net/http'
86
+ host = ENV['RUBYGEMS_HOST'] || Gem.host
87
+ uri = URI.parse "#{host}/#{path}"
88
+
89
+ request_method = Net::HTTP.const_get method.to_s.capitalize
90
+
91
+ Gem::RemoteFetcher.fetcher.request(uri, request_method, &block)
92
+ end
93
+
94
+ def request(method, path, &block)
95
+ response = raw_request(method, path, &block)
88
96
  response.body
89
97
  end
90
98
  end
data/lib/spade/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Spade
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
data/spade.gemspec CHANGED
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
13
13
  s.homepage = "http://github.com/strobecorp/spade"
14
14
  s.summary = s.description = "Unified JavaScript runner for browser and command line"
15
15
 
16
- s.required_rubygems_version = ">= 1.3.6"
16
+ s.required_rubygems_version = "~> 1.7.1"
17
17
 
18
18
  mswin = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
19
19
  mri = !mswin && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
@@ -38,6 +38,5 @@ Gem::Specification.new do |s|
38
38
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
39
39
 
40
40
  s.executables = ['spade']
41
- s.default_executable = "spade"
42
41
  s.require_paths = ["lib"]
43
42
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: spade
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.4
5
+ version: 0.0.5
6
6
  platform: ruby
7
7
  authors:
8
8
  - Charles Jolley
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-04-04 00:00:00 -07:00
14
- default_executable: spade
13
+ date: 2011-04-05 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: gemcutter
@@ -480,7 +479,6 @@ files:
480
479
  - spec/support/matchers.rb
481
480
  - spec/support/path.rb
482
481
  - test-spade.html
483
- has_rdoc: true
484
482
  homepage: http://github.com/strobecorp/spade
485
483
  licenses: []
486
484
 
@@ -498,13 +496,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
498
496
  required_rubygems_version: !ruby/object:Gem::Requirement
499
497
  none: false
500
498
  requirements:
501
- - - ">="
499
+ - - ~>
502
500
  - !ruby/object:Gem::Version
503
- version: 1.3.6
501
+ version: 1.7.1
504
502
  requirements: []
505
503
 
506
504
  rubyforge_project:
507
- rubygems_version: 1.5.2
505
+ rubygems_version: 1.7.1
508
506
  signing_key:
509
507
  specification_version: 3
510
508
  summary: Unified JavaScript runner for browser and command line