netprint 0.3.1 → 0.3.3

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
- SHA1:
3
- metadata.gz: fd835b4a184d0da47107907c553c01f38e2c2504
4
- data.tar.gz: a1fd1a69deb580a1076af3a1f1f36d516046f787
2
+ SHA256:
3
+ metadata.gz: b06edd14f5f6309d61b120d16ba03ed3aeca88f3d2e34f43eea5d8a6055bb796
4
+ data.tar.gz: c64afabd3b94a7e4c51a498b74d8224e10235e892973e3c53eb55ac7358ffc32
5
5
  SHA512:
6
- metadata.gz: 1681f849daa7029306a39edebeea971e9f8a0cfc90c15483c01ff90e4b00253a746b9b9e3c1f9c80fe508675dfb882bd25785126f800992d343c4434e479af88
7
- data.tar.gz: ec49ee335fec0cffd88147532790adc2bdc1e881624f32ac6525668c92043a58d66898408175546dc4c8a1993a40b3c164be1b0b67fdf75b2e6c2c75f83a511c
6
+ metadata.gz: cd70cd4b9aeaed52223ee9280048eb5e88ad19a4b2425746abcec047fb9aa0016735fdebcca68b29cba6df53cc5539e44fc8964965527dea41aed9195844b580
7
+ data.tar.gz: 42d205e471e8461670c437b951cbda7ea5d7f113afb560c7425350abef0dd4729f28601b8e69b0ec8d7801fd786a275eedc571801342f8d3dba65cc118cd0643
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Netprint [![Build Status](https://secure.travis-ci.org/youpy/netprint.png)](http://secure.travis-ci.org/youpy/netprint)
2
2
 
3
- A library to use netprint(https://www.printing.ne.jp/)
3
+ A library and command line tool for using [netprint](https://www.printing.ne.jp/)
4
4
 
5
5
  ## Installation
6
6
 
@@ -36,5 +36,5 @@ rescue Docopt::Exit => e
36
36
  rescue Netprint::UploadError => e
37
37
  abort '%s: %s' % [$0, e.message]
38
38
  rescue Netprint::RegistrationError => e
39
- abort '%s: An registration error occured' % $0
39
+ abort '%s: A registration error occured' % $0
40
40
  end
@@ -89,7 +89,6 @@ module Netprint
89
89
 
90
90
  def mechanize
91
91
  @mechanize ||= Mechanize.new
92
- @mechanize.ssl_version = :TLSv1
93
92
  @mechanize
94
93
  end
95
94
  end
@@ -1,3 +1,3 @@
1
1
  module Netprint
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.3"
3
3
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
16
16
  gem.version = Netprint::VERSION
17
17
 
18
18
  gem.add_development_dependency('rspec', ['~> 2.8.0'])
19
- gem.add_development_dependency('rake')
19
+ gem.add_development_dependency('rake', '< 11.0')
20
20
  gem.add_development_dependency('webmock')
21
21
  gem.add_dependency('mechanize', '2.7.0')
22
22
  gem.add_dependency('docopt')
File without changes
File without changes
@@ -8,7 +8,7 @@ describe Agent do
8
8
  @agent = Agent.new('user_id', 'password')
9
9
 
10
10
  stub_request(:get, 'https://www.printing.ne.jp/usr/web/NPCM0010.seam').
11
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../login.html')).read)
11
+ to_return(read_fixture_file('login.html'))
12
12
 
13
13
  stub_request(:post, 'https://www.printing.ne.jp/usr/web/NPCM0010.seam').
14
14
  with(body: {
@@ -20,7 +20,7 @@ describe Agent do
20
20
  'javax.faces.ViewState' => 'bar'
21
21
  }
22
22
  ).
23
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../list_empty.html')).read)
23
+ to_return(read_fixture_file('list_empty.html'))
24
24
  end
25
25
 
26
26
  it 'should login' do
@@ -42,10 +42,10 @@ describe Agent do
42
42
  'javax.faces.ViewState' => 'yyy'
43
43
  }
44
44
  ).
45
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../upload.html')).read)
45
+ to_return(read_fixture_file('upload.html'))
46
46
 
47
47
  stub_request(:post, 'https://www.printing.ne.jp/usr/web/auth/NPFL0020.seam').
48
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../list_processing.html')).read)
48
+ to_return(read_fixture_file('list_processing.html'))
49
49
 
50
50
  stub_request(:post, 'https://www.printing.ne.jp/usr/web/auth/NPFL0010.seam').
51
51
  with(body: {
@@ -56,7 +56,7 @@ describe Agent do
56
56
  'javax.faces.ViewState' => 'yyy'
57
57
  }
58
58
  ).
59
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../list_processed.html')).read)
59
+ to_return(read_fixture_file('list_processed.html'))
60
60
 
61
61
  filename = File.expand_path(pdf_filename)
62
62
  @agent.login
@@ -75,10 +75,10 @@ describe Agent do
75
75
  'javax.faces.ViewState' => 'yyy'
76
76
  }
77
77
  ).
78
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../upload.html')).read)
78
+ to_return(read_fixture_file('upload.html'))
79
79
 
80
80
  stub_request(:post, 'https://www.printing.ne.jp/usr/web/auth/NPFL0020.seam').
81
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../list_processing.html')).read)
81
+ to_return(read_fixture_file('list_processing.html'))
82
82
 
83
83
  stub_request(:post, 'https://www.printing.ne.jp/usr/web/auth/NPFL0010.seam').
84
84
  with(body: {
@@ -89,7 +89,7 @@ describe Agent do
89
89
  'javax.faces.ViewState' => 'yyy'
90
90
  }
91
91
  ).
92
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../list_error.html')).read)
92
+ to_return(read_fixture_file('list_error.html'))
93
93
 
94
94
  filename = File.expand_path(pdf_filename)
95
95
  @agent.login
@@ -109,10 +109,10 @@ describe Agent do
109
109
  'javax.faces.ViewState' => 'yyy'
110
110
  }
111
111
  ).
112
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../upload.html')).read)
112
+ to_return(read_fixture_file('upload.html'))
113
113
 
114
114
  stub_request(:post, 'https://www.printing.ne.jp/usr/web/auth/NPFL0020.seam').
115
- to_return(open(File.expand_path(File.dirname(__FILE__) + '/../upload_error.html')).read)
115
+ to_return(read_fixture_file('upload_error.html'))
116
116
 
117
117
  filename = File.expand_path(pdf_filename)
118
118
  @agent.login
@@ -124,13 +124,13 @@ describe Agent do
124
124
  end
125
125
 
126
126
  context 'filename is ASCII only' do
127
- let(:pdf_filename) { File.dirname(__FILE__) + '/../foo.pdf' }
127
+ let(:pdf_filename) { fixture_file('foo.pdf') }
128
128
 
129
129
  it_should_behave_like '#upload'
130
130
  end
131
131
 
132
132
  context 'filename has non-ASCII characters' do
133
- let(:pdf_filename) { File.dirname(__FILE__) + '/../あいうえお.pdf' }
133
+ let(:pdf_filename) { fixture_file('あいうえお.pdf') }
134
134
 
135
135
  it_should_behave_like '#upload'
136
136
  end
@@ -18,6 +18,14 @@ RSpec.configure do |config|
18
18
  # the seed, which is printed after each run.
19
19
  # --seed 1234
20
20
  config.order = 'random'
21
+
22
+ def fixture_file(name)
23
+ File.expand_path(File.dirname(__FILE__) + '/fixtures/' + name)
24
+ end
25
+
26
+ def read_fixture_file(name)
27
+ open(fixture_file(name)).read
28
+ end
21
29
  end
22
30
 
23
31
  RSpec::Matchers.define :be_checked do |name, value|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: netprint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - youpy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-08 00:00:00.000000000 Z
11
+ date: 2020-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '11.0'
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: '11.0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: webmock
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -103,18 +103,18 @@ files:
103
103
  - lib/netprint/options.rb
104
104
  - lib/netprint/version.rb
105
105
  - netprint.gemspec
106
- - spec/foo.pdf
107
- - spec/list_empty.html
108
- - spec/list_error.html
109
- - spec/list_processed.html
110
- - spec/list_processing.html
111
- - spec/login.html
106
+ - spec/fixtures/foo.pdf
107
+ - spec/fixtures/list_empty.html
108
+ - spec/fixtures/list_error.html
109
+ - spec/fixtures/list_processed.html
110
+ - spec/fixtures/list_processing.html
111
+ - spec/fixtures/login.html
112
+ - spec/fixtures/upload.html
113
+ - spec/fixtures/upload_error.html
114
+ - spec/fixtures/あいうえお.pdf
112
115
  - spec/netprint/agent_spec.rb
113
116
  - spec/netprint/options_spec.rb
114
117
  - spec/spec_helper.rb
115
- - spec/upload.html
116
- - spec/upload_error.html
117
- - spec/あいうえお.pdf
118
118
  homepage: ''
119
119
  licenses: []
120
120
  metadata: {}
@@ -133,21 +133,20 @@ required_rubygems_version: !ruby/object:Gem::Requirement
133
133
  - !ruby/object:Gem::Version
134
134
  version: '0'
135
135
  requirements: []
136
- rubyforge_project:
137
- rubygems_version: 2.2.0.rc.1
136
+ rubygems_version: 3.1.2
138
137
  signing_key:
139
138
  specification_version: 4
140
139
  summary: A library to upload file to netprint
141
140
  test_files:
142
- - spec/foo.pdf
143
- - spec/list_empty.html
144
- - spec/list_error.html
145
- - spec/list_processed.html
146
- - spec/list_processing.html
147
- - spec/login.html
141
+ - spec/fixtures/foo.pdf
142
+ - spec/fixtures/list_empty.html
143
+ - spec/fixtures/list_error.html
144
+ - spec/fixtures/list_processed.html
145
+ - spec/fixtures/list_processing.html
146
+ - spec/fixtures/login.html
147
+ - spec/fixtures/upload.html
148
+ - spec/fixtures/upload_error.html
149
+ - spec/fixtures/あいうえお.pdf
148
150
  - spec/netprint/agent_spec.rb
149
151
  - spec/netprint/options_spec.rb
150
152
  - spec/spec_helper.rb
151
- - spec/upload.html
152
- - spec/upload_error.html
153
- - spec/あいうえお.pdf