wagon 0.10.5 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,11 +1,11 @@
1
- class Member
2
- attr_reader :household, :name, :email
3
-
4
- def initialize(household, name, email)
5
- @household, @name, @email = household, name, email
6
- end
7
-
8
- def to_s
9
- [name, household.name, email.to_s.empty? ? nil : "<#{email}>"].compact.join(" ")
10
- end
1
+ class Member
2
+ attr_reader :household, :name, :email
3
+
4
+ def initialize(household, name, email)
5
+ @household, @name, @email = household, name, email
6
+ end
7
+
8
+ def to_s
9
+ [name, household.name, email.to_s.empty? ? nil : "<#{email}>"].compact.join(" ")
10
+ end
11
11
  end
@@ -1,31 +1,30 @@
1
- require 'nokogiri'
2
-
3
- module Wagon
4
- class Page
5
- attr_reader :connection
6
-
7
- def initialize(connection, url, parent = nil)
8
- @connection, @url, @parent = connection, url, parent
9
- end
10
-
11
- def source
12
- @source ||= Nokogiri::HTML(get(@url))
13
- end
14
-
15
- def get(*args)
16
- connection.get(*args)
17
- end
18
-
19
- def post(*args)
20
- connection.post(*args)
21
- end
22
-
23
- def method_missing(method, *args, &block)
24
- unless source.respond_to?(method)
25
- super(method, *args, &block)
26
- else
27
- source.send(method, *args, &block)
28
- end
29
- end
30
- end
31
- end
1
+ require 'nokogiri'
2
+
3
+ module Wagon
4
+ class Page
5
+ attr_reader :connection, :source
6
+
7
+ def initialize(connection, url, parent = nil)
8
+ @connection, @url, @parent = connection, url, parent
9
+ @source = Future(@url) do |url|
10
+ Nokogiri::HTML(get(url))
11
+ end
12
+ end
13
+
14
+ def get(*args)
15
+ connection.get(*args)
16
+ end
17
+
18
+ def post(*args)
19
+ connection.post(*args)
20
+ end
21
+
22
+ def method_missing(method, *args, &block)
23
+ unless source.respond_to?(method)
24
+ super(method, *args, &block)
25
+ else
26
+ source.send(method, *args, &block)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -1,23 +1,23 @@
1
- module Wagon
2
- class PhoneNumber
3
- attr_reader :type, :value
4
-
5
- def self.extract_from_string(string)
6
- string.strip =~ /([\)\(\+\s\-\d]+)(\((.*)\))?$/
7
- self.new($3 || 'Home', $1.to_s.strip)
8
- end
9
-
10
- def initialize(type, value)
11
- @type, @value = type, value
12
- end
13
-
14
- def ==(other)
15
- type == other.type &&
16
- value == other.value
17
- end
18
-
19
- def to_s
20
- self.value
21
- end
22
- end
1
+ module Wagon
2
+ class PhoneNumber
3
+ attr_reader :type, :value
4
+
5
+ def self.extract_from_string(string)
6
+ string.strip =~ /([\)\(\+\s\-\d]+)(\((.*)\))?$/
7
+ self.new($3 || 'Home', $1.to_s.strip)
8
+ end
9
+
10
+ def initialize(type, value)
11
+ @type, @value = type, value
12
+ end
13
+
14
+ def ==(other)
15
+ type == other.type &&
16
+ value == other.value
17
+ end
18
+
19
+ def to_s
20
+ self.value
21
+ end
22
+ end
23
23
  end
@@ -1,29 +1,29 @@
1
- require 'wagon/directory'
2
-
3
- module Wagon
4
- class Ward < Page
5
- def name
6
- @name ||= self.at('a.channeltitle[href^="/units/home"]').inner_text.strip
7
- end
8
-
9
- def directory_path
10
- @directory_path ||= '/units/a/directory/photoprint/1,10357,605-1-7-197742,00.html'
11
- end
12
-
13
- def directory
14
- @directory ||= Directory.new(connection, directory_path, self)
15
- end
16
-
17
- def households
18
- directory.households
19
- end
20
-
21
- def members
22
- households.collect(&:members).flatten()
23
- end
24
-
25
- def to_pdf(options)
26
- directory.to_pdf(options)
27
- end
28
- end
1
+ require 'wagon/directory'
2
+
3
+ module Wagon
4
+ class Ward < Page
5
+ def name
6
+ @name ||= self.at('a.channeltitle[href^="/units/home"]').inner_text.strip
7
+ end
8
+
9
+ def directory_path
10
+ @directory_path ||= '/units/a/directory/photoprint/1,10357,605-1-7-197742,00.html'
11
+ end
12
+
13
+ def directory
14
+ @directory ||= Directory.new(connection, directory_path, self)
15
+ end
16
+
17
+ def households
18
+ directory.households
19
+ end
20
+
21
+ def members
22
+ households.collect(&:members).flatten()
23
+ end
24
+
25
+ def to_pdf(options)
26
+ directory.to_pdf(options)
27
+ end
28
+ end
29
29
  end
@@ -1,22 +1,22 @@
1
- require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
2
-
3
- describe "Wagon::Directory" do
4
-
5
- before(:each) do
6
- @directory = Wagon::Directory.new($user, $user.ward.directory_path, $user.ward)
7
- end
8
-
9
- it "should find the photo directory link" do
10
- @directory.instance_variable_get(:@url).should_not be_nil
11
- @directory.instance_variable_get(:@url).should match(%r{^/units/a/directory/photoprint})
12
- end
13
-
14
- it "should be able to generate a pdf" do
15
- lambda { @directory.to_pdf.render_file("./photo_directory.pdf") }.should_not raise_error
16
- end
17
-
18
- it "should parse out the households correctly" do
19
- @directory.households.should have_at_least(10).items
20
- end
21
-
22
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
2
+
3
+ describe "Wagon::Directory" do
4
+
5
+ before(:each) do
6
+ @directory = Wagon::Directory.new($user, $user.ward.directory_path, $user.ward)
7
+ end
8
+
9
+ it "should find the photo directory link" do
10
+ @directory.instance_variable_get(:@url).should_not be_nil
11
+ @directory.instance_variable_get(:@url).should match(%r{^/units/a/directory/photoprint})
12
+ end
13
+
14
+ it "should be able to generate a pdf" do
15
+ lambda { @directory.to_pdf.render_file("./photo_directory.pdf") }.should_not raise_error
16
+ end
17
+
18
+ it "should parse out the households correctly" do
19
+ @directory.households.should have_at_least(10).items
20
+ end
21
+
22
+ end
@@ -1,18 +1,18 @@
1
- require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
2
-
3
- describe "Wagon::Ward" do
4
-
5
- before(:each) do
6
- @page = Wagon::Ward.new($user, $user.home_path)
7
- end
8
-
9
- it "should have a name" do
10
- @page.name.to_s.should_not be_empty
11
- end
12
-
13
- it "should find the directory link" do
14
- @page.directory_path.should_not be_nil
15
- @page.directory_path.should match(%r{^/units/a/directory})
16
- end
17
-
18
- end
1
+ require File.expand_path(File.dirname(__FILE__) + '../../spec_helper')
2
+
3
+ describe "Wagon::Ward" do
4
+
5
+ before(:each) do
6
+ @page = Wagon::Ward.new($user, $user.home_path)
7
+ end
8
+
9
+ it "should have a name" do
10
+ @page.name.to_s.should_not be_empty
11
+ end
12
+
13
+ it "should find the directory link" do
14
+ @page.directory_path.should_not be_nil
15
+ @page.directory_path.should match(%r{^/units/a/directory})
16
+ end
17
+
18
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wagon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Devin Christensen
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-04 00:00:00 -07:00
12
+ date: 2010-01-12 00:00:00 -07:00
13
13
  default_executable: wagon
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -42,6 +42,16 @@ dependencies:
42
42
  - !ruby/object:Gem::Version
43
43
  version: 0.5.1
44
44
  version:
45
+ - !ruby/object:Gem::Dependency
46
+ name: queue_to_the_future
47
+ type: :runtime
48
+ version_requirement:
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: 0.1.0
54
+ version:
45
55
  - !ruby/object:Gem::Dependency
46
56
  name: rspec
47
57
  type: :development
@@ -80,6 +90,29 @@ files:
80
90
  - VERSION
81
91
  - bin/wagon
82
92
  - extra/placeholder.jpg
93
+ - gui/Rakefile
94
+ - gui/build.xml
95
+ - gui/build/classes/.netbeans_automatic_build
96
+ - gui/build/classes/org/rubyforge/rawr/Main.class
97
+ - gui/build_configuration.rb
98
+ - gui/icons/monkeybars.icns
99
+ - gui/icons/monkeybars.ico
100
+ - gui/lib/java/jruby-complete.jar
101
+ - gui/lib/java/monkeybars-1.0.4.jar
102
+ - gui/lib/ruby/README.txt
103
+ - gui/manifest.mf
104
+ - gui/nbproject/build-impl.xml
105
+ - gui/nbproject/genfiles.properties
106
+ - gui/nbproject/private/private.properties
107
+ - gui/nbproject/project.properties
108
+ - gui/nbproject/project.xml
109
+ - gui/src/application_controller.rb
110
+ - gui/src/application_view.rb
111
+ - gui/src/main.rb
112
+ - gui/src/manifest.rb
113
+ - gui/src/org/rubyforge/rawr/Main.java
114
+ - gui/src/resolver.rb
115
+ - gui/tasks/monkeybars.rake
83
116
  - lib/wagon.rb
84
117
  - lib/wagon/address.rb
85
118
  - lib/wagon/connection.rb