cuprint 0.1.0

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.
@@ -0,0 +1,5 @@
1
+ README.rdoc
2
+ lib/**/*.rb
3
+ bin/*
4
+ features/**/*.feature
5
+ LICENSE
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Reuben Doetsch
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ = cuprint
2
+
3
+ Description goes here.
4
+
5
+ == Note on Patches/Pull Requests
6
+
7
+ * Fork the project.
8
+ * Make your feature addition or bug
9
+ * Add tests for it. This is important so I don't break it in a
10
+ future version unintentionally.
11
+ * Commit, do not mess with rakefile, version, or history.
12
+ (if you want to have your own version, that is fine but
13
+ bump version in a commit by itself I can ignore when I pull)
14
+ * Send me a pull request. Bonus points for topic branches.
15
+
16
+ == Copyright
17
+
18
+ Copyright (c) 2009 Reuben Doetsch. See LICENSE for details.
@@ -0,0 +1,57 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+
4
+ begin
5
+ require 'jeweler'
6
+ Jeweler::Tasks.new do |gem|
7
+ gem.name = "cuprint"
8
+ gem.summary = %Q{Oh so perfect}
9
+ gem.description = %Q{A gem to automate adding Columbia Printers}
10
+ gem.description = %Q{A gem to automate adding Columbia Printers}
11
+ gem.email = "reuben.doetsch@gmail.com"
12
+ gem.homepage = "http://github.com/hjast/cuprint"
13
+ gem.authors = ["Reuben Doetsch"]
14
+ gem.add_development_dependency "thoughtbot-shoulda"
15
+ # gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
16
+ end
17
+ rescue LoadError
18
+ puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
19
+ end
20
+
21
+ require 'rake/testtask'
22
+ Rake::TestTask.new(:test) do |test|
23
+ test.libs << 'lib' << 'test'
24
+ test.pattern = 'test/**/*_test.rb'
25
+ test.verbose = true
26
+ end
27
+
28
+ begin
29
+ require 'rcov/rcovtask'
30
+ Rcov::RcovTask.new do |test|
31
+ test.libs << 'test'
32
+ test.pattern = 'test/**/*_test.rb'
33
+ test.verbose = true
34
+ end
35
+ rescue LoadError
36
+ task :rcov do
37
+ abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
38
+ end
39
+ end
40
+
41
+ task :test => :check_dependencies
42
+
43
+ task :default => :test
44
+
45
+ require 'rake/rdoctask'
46
+ Rake::RDocTask.new do |rdoc|
47
+ if File.exist?('VERSION')
48
+ version = File.read('VERSION')
49
+ else
50
+ version = ""
51
+ end
52
+
53
+ rdoc.rdoc_dir = 'rdoc'
54
+ rdoc.title = "cuprint #{version}"
55
+ rdoc.rdoc_files.include('README*')
56
+ rdoc.rdoc_files.include('lib/**/*.rb')
57
+ end
data/VERSION ADDED
@@ -0,0 +1 @@
1
+ 0.1.0
@@ -0,0 +1,9 @@
1
+ #!/usr/bin/ruby
2
+
3
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+
5
+ require 'cuprint'
6
+
7
+ include CuPrint
8
+
9
+ run
@@ -0,0 +1,56 @@
1
+ # Generated by jeweler
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
+ # -*- encoding: utf-8 -*-
5
+
6
+ Gem::Specification.new do |s|
7
+ s.name = %q{cuprint}
8
+ s.version = "0.1.0"
9
+
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Reuben Doetsch"]
12
+ s.date = %q{2009-10-20}
13
+ s.default_executable = %q{cuprint}
14
+ s.description = %q{A gem to automate adding Columbia Printers}
15
+ s.email = %q{reuben.doetsch@gmail.com}
16
+ s.executables = ["cuprint"]
17
+ s.extra_rdoc_files = [
18
+ "LICENSE",
19
+ "README.rdoc"
20
+ ]
21
+ s.files = [
22
+ ".document",
23
+ "LICENSE",
24
+ "README.rdoc",
25
+ "Rakefile",
26
+ "VERSION",
27
+ "bin/cuprint",
28
+ "cuprint.gemspec",
29
+ "lib/cuprint.rb",
30
+ "lib/printers.yaml",
31
+ "test/cuprint_test.rb",
32
+ "test/test_helper.rb"
33
+ ]
34
+ s.homepage = %q{http://github.com/hjast/cuprint}
35
+ s.rdoc_options = ["--charset=UTF-8"]
36
+ s.require_paths = ["lib"]
37
+ s.rubygems_version = %q{1.3.5}
38
+ s.summary = %q{Oh so perfect}
39
+ s.test_files = [
40
+ "test/cuprint_test.rb",
41
+ "test/test_helper.rb"
42
+ ]
43
+
44
+ if s.respond_to? :specification_version then
45
+ current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
46
+ s.specification_version = 3
47
+
48
+ if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
49
+ s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
50
+ else
51
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
52
+ end
53
+ else
54
+ s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
55
+ end
56
+ end
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/ruby
2
+ #Reuben Doetsch
3
+ #Will work on 10.6
4
+ require 'yaml'
5
+
6
+ module CuPrint
7
+
8
+ OPTION_MENU = "1.) Add printer\n 2.) Add all printers\n 3.) Quit ";
9
+ Struct.new("Printer", :name, :place,:address, :driver)
10
+
11
+ def run
12
+ printersArray = YAML.load_file(File.join(File.dirname(__FILE__), 'printers.yaml'))["printers"]
13
+ printers= Array.new
14
+ printersArray.each { |printerHash| printers << Struct::Printer.new(printerHash["name"], printerHash["place"],printerHash["address"], printerHash["driver"]) }
15
+
16
+ exit = false
17
+ while(!exit)
18
+ puts OPTION_MENU
19
+ case gets.to_i
20
+ when 1
21
+ puts "Printers"
22
+ printers.each_index { |x| puts x.to_s + ".)" + printers[x]["name"] }
23
+ add_printer(printers[gets.to_i])
24
+ when 2
25
+ printers.each { |x| add_printer(x) }
26
+ when 3
27
+ exit= true
28
+ end
29
+ end
30
+
31
+ end
32
+
33
+ def add_printer(print)
34
+ driver = case print["driver"]
35
+ when "HP LaserJet 9050" ; "/Library/Printers/PPDs/Contents/Resources/HP\\ LaserJet\\ 9050.gz"
36
+ when "HP LaserJet 4350" ; " /Library/Printers/PPDs/Contents/Resources/HP\\ LaserJet\\ 4350.gz"
37
+ end
38
+ puts driver
39
+ `lpadmin -p #{print["name"]} -L #{print["place"]} -E -v lpd://#{print["address"]} -P #{driver} `
40
+ end
41
+ #{}`lpadmin -p "mudd" -L "Mudd Library" -E -v lpd://mudd251a-ninja.atg.columbia.edu -P /Library/Printers/PPDs/Contents/Resources/HP\ LaserJet\ 9050.gz`
42
+
43
+
44
+ end
@@ -0,0 +1,284 @@
1
+ printers:
2
+ - name: 'broadway304a'
3
+ address: broadway304a-ninja.atg.columbia.edu
4
+ driver: HP LaserJet 9050
5
+ place: Residence Halls
6
+ - name: butler209a
7
+ address: butler209a-ninja.atg.columbia.edu
8
+ driver: HP LaserJet 9050
9
+ place: Butler
10
+ - name: butler209b
11
+ address: butler209b-ninja.atg.columbia.edu
12
+ driver: HP LaserJet 9050
13
+ place: Butler
14
+ - name: butler213a
15
+ address: butler213a-ninja.atg.columbia.edu
16
+ driver: HP LaserJet 9050
17
+ place: Butler
18
+ - name: butler213b
19
+ address: butler213b-ninja.atg.columbia.edu
20
+ driver: HP LaserJet 9050
21
+ place: Butler
22
+ - name: butler213c
23
+ address: butler213c-ninja.atg.columbia.edu
24
+ driver: HP LaserJet 9050
25
+ place: Butler
26
+ - name: butler300a
27
+ address: butler300a-ninja.atg.columbia.edu
28
+ driver: HP LaserJet 9050
29
+ place: Butler
30
+ - name: butler300b
31
+ address: butler300b-ninja.atg.columbia.edu
32
+ driver: HP LaserJet 9050
33
+ place: Butler
34
+ - name: butler403a
35
+ address: butler403a-ninja.atg.columbia.edu
36
+ driver: HP LaserJet 9050
37
+ place: Butler
38
+ - name: butler403b
39
+ address: butler403b-ninja.atg.columbia.edu
40
+ driver: HP LaserJet 9050
41
+ place: Butler
42
+ - name: carman103a
43
+ address: carman103a-ninja.atg.columbia.edu
44
+ driver: HP LaserJet 9050
45
+ place: Residence Halls
46
+ - name: carman103b
47
+ address: carman103b-ninja.atg.columbia.edu
48
+ driver: HP LaserJet 9050
49
+ place: Residence Halls
50
+ - name: claremontb01a
51
+ address: claremontb01a-ninja.atg.columbia.edu
52
+ driver: HP LaserJet 9050
53
+ place: Residence Halls
54
+ - name: ec10a
55
+ address: ec10a-ninja.atg.columbia.edu
56
+ driver: HP LaserJet 9050 Series
57
+ place: Residence Halls
58
+ - name: ec18a
59
+ address: ec18a-ninja.atg.columbia.edu
60
+ driver: HP LaserJet 9050 Series
61
+ place: Residence Halls
62
+ - name: furnald102a
63
+ address: furnald102a-ninja.atg.columbia.edu
64
+ driver: HP LaserJet 9050
65
+ place: Residence Halls
66
+ - name: hartley112a
67
+ address: hartley112a-ninja.atg.columbia.edu
68
+ driver: HP LaserJet 9050
69
+ place: Residence Halls
70
+ - name: hartley112b
71
+ address: hartley112b-ninja.atg.columbia.edu
72
+ driver: HP LaserJet 9050
73
+ place: Residence Halls
74
+ - name: iab323a
75
+ address: iab323a-ninja.atg.columbia.edu
76
+ driver: HP LaserJet 9050
77
+ place: International Affairs
78
+ - name: iab323b
79
+ address: iab323b-ninja.atg.columbia.edu
80
+ driver: HP LaserJet 9050
81
+ place: International Affairs
82
+ - name: lerner200a
83
+ address: lerner200a-ninja.atg.columbia.edu
84
+ driver: HP LaserJet 9050
85
+ place: Lerner
86
+ - name: lerner200b
87
+ address: lerner200b-ninja.atg.columbia.edu
88
+ driver: HP LaserJet 9050
89
+ place: Lerner
90
+ - name: lerner300a
91
+ address: lerner300a-ninja.atg.columbia.edu
92
+ driver: HP LaserJet 9050
93
+ place: Lerner
94
+ - name: lerner300b
95
+ address: lerner300b-ninja.atg.columbia.edu
96
+ driver: HP LaserJet 9050
97
+ place: Lerner
98
+ - name: lewisohn300a
99
+ address: lewisohn300a-ninja.atg.columbia.edu
100
+ driver: HP LaserJet 9050
101
+ place: Lewisohn
102
+ - name: lewisohn300b
103
+ address: lewisohn300b-ninja.atg.columbia.edu
104
+ driver: HP LaserJet 9050
105
+ place: Lewisohn
106
+ - name: math407a
107
+ address: math407a-ninja.atg.columbia.edu
108
+ driver: HP LaserJet 9050
109
+ place: Math
110
+ - name: mcbain100a
111
+ address: mcbain100a-ninja.atg.columbia.edu
112
+ driver: HP LaserJet 9050
113
+ place: Residence Halls
114
+ - name: mudd251a
115
+ address: mudd251a-ninja.atg.columbia.edu
116
+ driver: HP LaserJet 9050
117
+ place: Mudd
118
+ - name: mudd251b
119
+ address: mudd251b-ninja.atg.columbia.edu
120
+ driver: HP LaserJet 9050
121
+ place: Mudd
122
+ - name: mudd251c
123
+ address: mudd251c-ninja.atg.columbia.edu
124
+ driver: HP LaserJet 9050
125
+ place: Mudd
126
+ - name: mudd422a
127
+ address: mudd422a-ninja.atg.columbia.edu
128
+ driver: HP LaserJet 9050
129
+ place: Mudd
130
+ - name: riverb01a
131
+ address: riverb01a-ninja.atg.columbia.edu
132
+ driver: HP LaserJet 9050
133
+ place: Residence Halls
134
+ - name: schapiro108a
135
+ address: schapiro108a-ninja.atg.columbia.edu
136
+ driver: HP LaserJet 9050
137
+ place: Residence Halls
138
+ - name: schermerhorn558a
139
+ address: schermerhorn558a-ninja.atg.columbia.edu
140
+ driver: HP LaserJet 9050
141
+ place: Schermerhorn
142
+ - name: wien211a
143
+ address: wien211a-ninja.atg.columbia.edu
144
+ driver: HP LaserJet 9050
145
+ place: Residence Halls
146
+ - name: wien211b
147
+ address: wien211b-ninja.atg.columbia.edu
148
+ driver: HP LaserJet 9050
149
+ place: Residence Halls
150
+ - name: brooks100a
151
+ address: brooks100a-ninja.barnard.edu
152
+ driver: HP LaserJet 9050
153
+ place: Barnard
154
+ - name: brooks100b
155
+ address: brooks100b-ninja.barnard.edu
156
+ driver: HP LaserJet 9050
157
+ place: Barnard
158
+
159
+ - name: lcc100a
160
+ address: lcc100a-ninja.barnard.edu
161
+ driver: HP LaserJet 9050
162
+ place: Barnard
163
+
164
+ - name: lcc100b
165
+ address: lcc100b-ninja.barnard.edu
166
+ driver: HP LaserJet 9050
167
+ place: Barnard
168
+
169
+ - name: plimpton100a
170
+ address: plimpton100a-ninja.barnard.edu
171
+ driver: HP LaserJet 9050
172
+ place: Barnard
173
+
174
+ - name: plimpton100b
175
+ address: plimpton100b-ninja.barnard.edu
176
+ driver: HP LaserJet 9050
177
+ place: Barnard
178
+
179
+ - name: sixsixteen100a
180
+ address: sixsixteen100a-ninja.barnard.edu
181
+ driver: HP LaserJet 9050
182
+ place: Barnard
183
+
184
+ - name: sixsixteen100b
185
+ address: sixsixteen100b-ninja.barnard.edu
186
+ driver: HP LaserJet 9050
187
+ place: Barnard
188
+
189
+ - name: sulzberger100a
190
+ address: sulzberger100a-ninja.barnard.edu
191
+ driver: HP LaserJet 9050
192
+ place: Barnard
193
+
194
+ #Other
195
+
196
+ - name: avery200a
197
+ address: avery200a-ninja.atg.columbia.edu
198
+ driver: HP LaserJet 4350
199
+ place: Avery
200
+
201
+ - name: burke300a
202
+ address: burke300a-ninja.atg.columbia.edu
203
+ driver: HP LaserJet 4350
204
+ place: Burke
205
+
206
+ - name: butler301a
207
+ address: butler301a-ninja.atg.columbia.edu
208
+ driver: HP LaserJet 4350
209
+ place: Butler
210
+
211
+ - name: butler305a
212
+ address: butler305a-ninja.atg.columbia.edu
213
+ driver: HP LaserJet 4350
214
+ place: Butler
215
+
216
+ - name: butler401a
217
+ address: butler401a-ninja.atg.columbia.edu
218
+ driver: HP LaserJet 4350
219
+ place: Butler
220
+
221
+ - name: butler501a
222
+ address: butler501a-ninja.atg.columbia.edu
223
+ driver: HP LaserJet 4350
224
+ place: Butler
225
+
226
+ - name: butler600a
227
+ address: butler600a-ninja.atg.columbia.edu
228
+ driver: HP LaserJet 4350
229
+ place: Butler
230
+
231
+ - name: butler606a
232
+ address: butler606a-ninja.atg.columbia.edu
233
+ driver: HP LaserJet 4350
234
+ place: Butler
235
+
236
+ - name: iab310a
237
+ address: iab310a-ninja.atg.columbia.edu
238
+ driver: HP LaserJet 9050
239
+ place: International Affairs
240
+
241
+ - name: iab329a
242
+ address: iab329a-ninja.atg.columbia.edu
243
+ driver: HP LaserJet 9050
244
+ place: International Affairs
245
+
246
+ - name: kent300a
247
+ address: kent300a-ninja.atg.columbia.edu
248
+ driver: HP LaserJet 4350
249
+ place: Kent
250
+
251
+ - name: kent300b
252
+ address: kent300b-ninja.atg.columbia.edu
253
+ driver: HP LaserJet 4350
254
+ place: Kent
255
+
256
+ - name: math303a
257
+ address: math303a-ninja.atg.columbia.edu
258
+ driver: HP LaserJet 4350
259
+ place: Math
260
+
261
+ - name: schermerhorn601a
262
+ address: schermerhorn601a-ninja.atg.columbia.edu
263
+ driver: HP LaserJet 4350
264
+ place: Schermerhorn
265
+
266
+ - name: uris130a
267
+ address: uris130a-ninja.atg.columbia.edu
268
+ driver: HP LaserJet 9050
269
+ place: Uris
270
+
271
+ - name: uris130b
272
+ address: uris130b-ninja.atg.columbia.edu
273
+ driver: HP LaserJet 9050
274
+ place: Uris
275
+
276
+ - name: uris130c
277
+ address: uris130c-ninja.atg.columbia.edu
278
+ driver: HP LaserJet 9050
279
+ place: Uris
280
+
281
+ - name: uris130d
282
+ address: uris130d-ninja.atg.columbia.edu
283
+ driver: HP LaserJet 9050
284
+ place: Uris
@@ -0,0 +1,7 @@
1
+ require 'test_helper'
2
+
3
+ class CuprintTest < Test::Unit::TestCase
4
+ should "probably rename this file and start testing for real" do
5
+ flunk "hey buddy, you should probably rename this file and start testing for real"
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ require 'rubygems'
2
+ require 'test/unit'
3
+ require 'shoulda'
4
+
5
+ $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
+ $LOAD_PATH.unshift(File.dirname(__FILE__))
7
+ require 'cuprint'
8
+
9
+ class Test::Unit::TestCase
10
+ end
metadata ADDED
@@ -0,0 +1,76 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cuprint
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Reuben Doetsch
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-10-20 00:00:00 -04:00
13
+ default_executable: cuprint
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: thoughtbot-shoulda
17
+ type: :development
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ description: A gem to automate adding Columbia Printers
26
+ email: reuben.doetsch@gmail.com
27
+ executables:
28
+ - cuprint
29
+ extensions: []
30
+
31
+ extra_rdoc_files:
32
+ - LICENSE
33
+ - README.rdoc
34
+ files:
35
+ - .document
36
+ - LICENSE
37
+ - README.rdoc
38
+ - Rakefile
39
+ - VERSION
40
+ - bin/cuprint
41
+ - cuprint.gemspec
42
+ - lib/cuprint.rb
43
+ - lib/printers.yaml
44
+ - test/cuprint_test.rb
45
+ - test/test_helper.rb
46
+ has_rdoc: true
47
+ homepage: http://github.com/hjast/cuprint
48
+ licenses: []
49
+
50
+ post_install_message:
51
+ rdoc_options:
52
+ - --charset=UTF-8
53
+ require_paths:
54
+ - lib
55
+ required_ruby_version: !ruby/object:Gem::Requirement
56
+ requirements:
57
+ - - ">="
58
+ - !ruby/object:Gem::Version
59
+ version: "0"
60
+ version:
61
+ required_rubygems_version: !ruby/object:Gem::Requirement
62
+ requirements:
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: "0"
66
+ version:
67
+ requirements: []
68
+
69
+ rubyforge_project:
70
+ rubygems_version: 1.3.5
71
+ signing_key:
72
+ specification_version: 3
73
+ summary: Oh so perfect
74
+ test_files:
75
+ - test/cuprint_test.rb
76
+ - test/test_helper.rb