netprint 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/README.md +1 -1
- data/bin/netprint +1 -1
- data/lib/netprint/agent.rb +0 -1
- data/lib/netprint/version.rb +1 -1
- data/netprint.gemspec +1 -1
- data/spec/{foo.pdf → fixtures/foo.pdf} +0 -0
- data/spec/{list_empty.html → fixtures/list_empty.html} +0 -0
- data/spec/{list_error.html → fixtures/list_error.html} +0 -0
- data/spec/{list_processed.html → fixtures/list_processed.html} +0 -0
- data/spec/{list_processing.html → fixtures/list_processing.html} +0 -0
- data/spec/{login.html → fixtures/login.html} +0 -0
- data/spec/{upload.html → fixtures/upload.html} +0 -0
- data/spec/{upload_error.html → fixtures/upload_error.html} +0 -0
- data/spec/{ → fixtures/}/343/201/202/343/201/204/343/201/206/343/201/210/343/201/212.pdf +0 -0
- data/spec/netprint/agent_spec.rb +12 -12
- data/spec/spec_helper.rb +8 -0
- metadata +25 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: b06edd14f5f6309d61b120d16ba03ed3aeca88f3d2e34f43eea5d8a6055bb796
|
4
|
+
data.tar.gz: c64afabd3b94a7e4c51a498b74d8224e10235e892973e3c53eb55ac7358ffc32
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cd70cd4b9aeaed52223ee9280048eb5e88ad19a4b2425746abcec047fb9aa0016735fdebcca68b29cba6df53cc5539e44fc8964965527dea41aed9195844b580
|
7
|
+
data.tar.gz: 42d205e471e8461670c437b951cbda7ea5d7f113afb560c7425350abef0dd4729f28601b8e69b0ec8d7801fd786a275eedc571801342f8d3dba65cc118cd0643
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Netprint [](http://secure.travis-ci.org/youpy/netprint)
|
2
2
|
|
3
|
-
A library
|
3
|
+
A library and command line tool for using [netprint](https://www.printing.ne.jp/)
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
data/bin/netprint
CHANGED
data/lib/netprint/agent.rb
CHANGED
data/lib/netprint/version.rb
CHANGED
data/netprint.gemspec
CHANGED
@@ -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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/spec/netprint/agent_spec.rb
CHANGED
@@ -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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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(
|
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) {
|
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) {
|
133
|
+
let(:pdf_filename) { fixture_file('あいうえお.pdf') }
|
134
134
|
|
135
135
|
it_should_behave_like '#upload'
|
136
136
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -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.
|
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:
|
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
|
-
|
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
|