resource_accessor 1.2.4 → 1.2.5

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: 91aa3aad7b244ffeaca70883e86d0fdded16ce78
4
- data.tar.gz: ae227c4946db340b0c5fac159d2882e9dfc5638e
3
+ metadata.gz: eb856d5526006c23c4e785dfb2930bdcd1e2affd
4
+ data.tar.gz: 088c6161ce26953604b62e96f68e6d9d9cd70115
5
5
  SHA512:
6
- metadata.gz: cb81e9f1fc0921239f68f90b6f1e0a19317ab3374a28858f14837719e2d2700821f40a131c547538497f57688d66a1f94b3f7b027fa78f1c361b3cd5fa76d806
7
- data.tar.gz: f6d405c25b15bccdf0f442111e0158b1919cac1242bc1327563db87998e7fcdd5c92c11a2e414b3d0c035d624acbb2939fc1fce2e59bc81b2dc19f34286ae0c7
6
+ metadata.gz: 50de3c8ddc2fde2c6218a928f1891cedd73a7d8dfc52af06e1031c570cfdfe503b69b046debdecf11f685ae43157a789c48d9a1583b446ac80ff055fb40ff25b
7
+ data.tar.gz: 8ae9a1e35fa6fd7e15d7474426d4e6d72c70365b1960b293eeea272038fdc13879e112a7d433f539db4ae128407b28e86c480e436f6ef0fe80296b5767d8b722
data/.gitignore CHANGED
@@ -7,4 +7,5 @@ rdoc
7
7
  tmp
8
8
  .idea/*.*
9
9
  *.gem
10
+ *.gemspec
10
11
 
@@ -1 +1 @@
1
- 2.1.4
1
+ 2.3.1
data/CHANGES CHANGED
@@ -32,6 +32,6 @@
32
32
 
33
33
  * Adding escape flag in order to control whether we want to escape parameter or not.
34
34
 
35
- == Version 1.2.4
35
+ == Version 1.2.4-1.2.5
36
36
 
37
37
  * Bug fix
data/Gemfile CHANGED
@@ -1,8 +1,14 @@
1
1
  source "https://rubygems.org"
2
2
 
3
+ ruby "2.3.1"
4
+
5
+ group :default do
6
+ end
7
+
3
8
  group :development do
4
- gem "gemspec_deps_gen"
5
- gem "gemcutter"
9
+ gem "gemspec_deps_gen", "~>1.1"
10
+ gem "gemcutter", "~>0.7"
11
+ gem "thor", "~>0.19"
6
12
  end
7
13
 
8
14
  group :test do
@@ -19,13 +19,21 @@ GEM
19
19
  rspec-expectations (2.14.2)
20
20
  diff-lcs (>= 1.1.3, < 2.0)
21
21
  rspec-mocks (2.14.3)
22
+ thor (0.19.1)
22
23
 
23
24
  PLATFORMS
24
25
  ruby
25
26
 
26
27
  DEPENDENCIES
27
- gemcutter
28
- gemspec_deps_gen
28
+ gemcutter (~> 0.7)
29
+ gemspec_deps_gen (~> 1.1)
29
30
  log4r
30
31
  mocha
31
32
  rspec
33
+ thor (~> 0.19)
34
+
35
+ RUBY VERSION
36
+ ruby 2.3.1p112
37
+
38
+ BUNDLED WITH
39
+ 1.12.5
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ $LOAD_PATH.unshift File.expand_path("lib", File.dirname(__FILE__))
4
+
5
+ require "thor"
6
+ require "resource_accessor/version"
7
+ require "gemspec_deps_gen/gemspec_deps_gen"
8
+
9
+ class ProjectCommands < Thor
10
+
11
+ def initialize *params
12
+ super
13
+
14
+ @version = ResourceAccessor::VERSION
15
+ @project_name = File.basename(Dir.pwd)
16
+ end
17
+
18
+ no_commands do
19
+ def generate
20
+ generator = GemspecDepsGen.new
21
+
22
+ print @project_name
23
+
24
+ generator.generate_dependencies "spec", "#{@project_name}.gemspec.erb", "#{@project_name}.gemspec"
25
+ end
26
+ end
27
+
28
+ desc "build", "build"
29
+ def build
30
+ generate
31
+
32
+ system "gem build #{@project_name}.gemspec"
33
+ end
34
+
35
+ desc "install", "install"
36
+ def install
37
+ system "gem install #{@project_name}-#{@version}.gem"
38
+ end
39
+
40
+ desc "uninstall", "uninstall"
41
+ def uninstall
42
+ system "gem uninstall #{@project_name}"
43
+ end
44
+
45
+ desc "release", "release"
46
+ def release
47
+ invoke :build
48
+ system "gem push #{@project_name}-#{@version}.gem"
49
+ end
50
+
51
+ desc "rspec", "rspec"
52
+ def rspec *args
53
+ system "`which rspec` #{args.join(' ')}"
54
+ end
55
+ end
56
+
57
+ ProjectCommands.start
@@ -56,7 +56,14 @@ class ResourceAccessor
56
56
  response = execute_request url, query, method, headers, body, escape, cookie
57
57
 
58
58
  if response.class == Net::HTTPMovedPermanently
59
- response = execute_request response['location'], method, headers, body, escape, cookie
59
+ location = response['location']
60
+
61
+ unless URI(location).scheme
62
+ new_uri = URI(url)
63
+ new_uri.path = response['location']
64
+ end
65
+
66
+ response = execute_request new_uri.to_s, query, method, headers, body, escape, cookie
60
67
  end
61
68
 
62
69
  response
@@ -1,3 +1,3 @@
1
- class ResourceAccessor
2
- VERSION = "1.2.4"
1
+ module ResourceAccessor
2
+ VERSION = "1.2.5"
3
3
  end
@@ -5,7 +5,7 @@ require File.expand_path(File.dirname(__FILE__) + '/lib/resource_accessor/versio
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "resource_accessor"
7
7
  spec.summary = %q{This library is used to simplify access to protected or unprotected http resource}
8
- spec.description = %q{This library is used to simplify access to protected or unprotected http resource}
8
+ spec.description = %q{This library is used to simplify access to protected or unprotected http resource.}
9
9
  spec.email = "alexander.shvets@gmail.com"
10
10
  spec.authors = ["Alexander Shvets"]
11
11
  spec.homepage = "http://github.com/shvets/resource_accessor"
metadata CHANGED
@@ -1,45 +1,59 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resource_accessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexander Shvets
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-12 00:00:00.000000000 Z
11
+ date: 2016-07-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gemspec_deps_gen
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '1.1'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: gemcutter
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '0.7'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '0.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: thor
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.19'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.19'
41
55
  description: This library is used to simplify access to protected or unprotected http
42
- resource
56
+ resource.
43
57
  email: alexander.shvets@gmail.com
44
58
  executables: []
45
59
  extensions: []
@@ -55,11 +69,10 @@ files:
55
69
  - Gemfile.lock
56
70
  - LICENSE
57
71
  - README.md
58
- - Rakefile
72
+ - Thorfile
59
73
  - lib/resource_accessor.rb
60
74
  - lib/resource_accessor/resource_accessor.rb
61
75
  - lib/resource_accessor/version.rb
62
- - resource_accessor.gemspec
63
76
  - resource_accessor.gemspec.erb
64
77
  - spec/gateway.rb
65
78
  - spec/gateway_spec.rb
@@ -85,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
85
98
  version: '0'
86
99
  requirements: []
87
100
  rubyforge_project:
88
- rubygems_version: 2.4.2
101
+ rubygems_version: 2.5.1
89
102
  signing_key:
90
103
  specification_version: 4
91
104
  summary: This library is used to simplify access to protected or unprotected http
data/Rakefile DELETED
@@ -1,38 +0,0 @@
1
- #!/usr/bin/env rake
2
-
3
- $LOAD_PATH.unshift File.expand_path("lib", File.dirname(__FILE__))
4
-
5
- require "rspec/core/rake_task"
6
- require "resource_accessor/version"
7
- require "gemspec_deps_gen/gemspec_deps_gen"
8
-
9
- version = ResourceAccessor::VERSION
10
- project_name = File.basename(Dir.pwd)
11
-
12
- task :gen do
13
- generator = GemspecDepsGen.new
14
-
15
- generator.generate_dependencies "spec", "#{project_name}.gemspec.erb", "#{project_name}.gemspec"
16
- end
17
-
18
- task :build => :gen do
19
- system "gem build #{project_name}.gemspec"
20
- end
21
-
22
- task :install do
23
- system "gem install #{project_name}-#{version}.gem"
24
- end
25
-
26
- task :uninstall do
27
- system "gem uninstall #{project_name}"
28
- end
29
-
30
- task :release => :build do
31
- system "gem push #{project_name}-#{version}.gem"
32
- end
33
-
34
- RSpec::Core::RakeTask.new do |task|
35
- task.pattern = 'spec/**/*_spec.rb'
36
- task.verbose = false
37
- end
38
-
@@ -1,24 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- require File.expand_path(File.dirname(__FILE__) + '/lib/resource_accessor/version')
4
-
5
- Gem::Specification.new do |spec|
6
- spec.name = "resource_accessor"
7
- spec.summary = %q{This library is used to simplify access to protected or unprotected http resource}
8
- spec.description = %q{This library is used to simplify access to protected or unprotected http resource}
9
- spec.email = "alexander.shvets@gmail.com"
10
- spec.authors = ["Alexander Shvets"]
11
- spec.homepage = "http://github.com/shvets/resource_accessor"
12
-
13
- spec.files = `git ls-files`.split($\)
14
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
15
- spec.require_paths = ["lib"]
16
- spec.version = ResourceAccessor::VERSION
17
- spec.license = "MIT"
18
-
19
-
20
- spec.add_development_dependency "gemspec_deps_gen", [">= 0"]
21
- spec.add_development_dependency "gemcutter", [">= 0"]
22
-
23
- end
24
-