Permalink
Browse files

Tests passing under Ruby 1.9.1, upgrading gems

  • Loading branch information...
1 parent 576c6f4 commit 8880b19c0017e709f6cac1c32054e6e911ec0967 @winton committed Nov 30, 2009
Showing with 701 additions and 11,408 deletions.
  1. +10 −12 README.markdown
  2. +20 −9 Rakefile
  3. +3 −3 config/externals.yml
  4. +0 −1 config/schedule.rb
  5. +3 −3 features/step_definitions/when.rb
  6. +16 −6 features/support/env.rb
  7. +13 −14 gemspec.rb
  8. +8 −8 lib/sum.rb
  9. +1 −1 lib/sum/helper/cron.rb
  10. +3 −3 lib/sum/model/user.rb
  11. +0 −69 sum.gemspec
  12. +1 −0 vendor/fetcher/.gitignore
  13. +20 −0 vendor/fetcher/MIT-LICENSE
  14. +94 −0 vendor/fetcher/README.rdoc
  15. +30 −0 vendor/fetcher/Rakefile
  16. +27 −0 vendor/fetcher/fetcher.gemspec
  17. +17 −0 vendor/fetcher/gemspec.rb
  18. 0 vendor/fetcher/init.rb
  19. +23 −0 vendor/fetcher/lib/fetcher.rb
  20. +63 −0 vendor/fetcher/lib/fetcher/base.rb
  21. +79 −0 vendor/fetcher/lib/fetcher/imap.rb
  22. +50 −0 vendor/fetcher/lib/fetcher/pop.rb
  23. +21 −0 vendor/fetcher/lib/vendor/plain_imap.rb
  24. +125 −0 vendor/fetcher/lib/vendor/secure_pop.rb
  25. +74 −0 vendor/fetcher/test/fetcher_test.rb
  26. +0 −4 vendor/webrat/.document
  27. +0 −15 vendor/webrat/.gitignore
  28. +0 −358 vendor/webrat/History.txt
  29. +0 −19 vendor/webrat/MIT-LICENSE.txt
  30. +0 −85 vendor/webrat/README.rdoc
  31. +0 −200 vendor/webrat/Rakefile
  32. +0 −1 vendor/webrat/install.rb
  33. +0 −31 vendor/webrat/lib/webrat.rb
  34. +0 −14 vendor/webrat/lib/webrat/core.rb
  35. +0 −102 vendor/webrat/lib/webrat/core/configuration.rb
  36. +0 −31 vendor/webrat/lib/webrat/core/elements/area.rb
  37. +0 −33 vendor/webrat/lib/webrat/core/elements/element.rb
  38. +0 −409 vendor/webrat/lib/webrat/core/elements/field.rb
  39. +0 −103 vendor/webrat/lib/webrat/core/elements/form.rb
  40. +0 −31 vendor/webrat/lib/webrat/core/elements/label.rb
  41. +0 −93 vendor/webrat/lib/webrat/core/elements/link.rb
  42. +0 −35 vendor/webrat/lib/webrat/core/elements/select_option.rb
  43. +0 −20 vendor/webrat/lib/webrat/core/locators.rb
  44. +0 −38 vendor/webrat/lib/webrat/core/locators/area_locator.rb
  45. +0 −54 vendor/webrat/lib/webrat/core/locators/button_locator.rb
  46. +0 −37 vendor/webrat/lib/webrat/core/locators/field_by_id_locator.rb
  47. +0 −56 vendor/webrat/lib/webrat/core/locators/field_labeled_locator.rb
  48. +0 −25 vendor/webrat/lib/webrat/core/locators/field_locator.rb
  49. +0 −41 vendor/webrat/lib/webrat/core/locators/field_named_locator.rb
  50. +0 −19 vendor/webrat/lib/webrat/core/locators/form_locator.rb
  51. +0 −34 vendor/webrat/lib/webrat/core/locators/label_locator.rb
  52. +0 −74 vendor/webrat/lib/webrat/core/locators/link_locator.rb
  53. +0 −20 vendor/webrat/lib/webrat/core/locators/locator.rb
  54. +0 −59 vendor/webrat/lib/webrat/core/locators/select_option_locator.rb
  55. +0 −24 vendor/webrat/lib/webrat/core/logging.rb
  56. +0 −4 vendor/webrat/lib/webrat/core/matchers.rb
  57. +0 −73 vendor/webrat/lib/webrat/core/matchers/have_content.rb
  58. +0 −74 vendor/webrat/lib/webrat/core/matchers/have_selector.rb
  59. +0 −21 vendor/webrat/lib/webrat/core/matchers/have_tag.rb
  60. +0 −147 vendor/webrat/lib/webrat/core/matchers/have_xpath.rb
  61. +0 −63 vendor/webrat/lib/webrat/core/methods.rb
  62. +0 −29 vendor/webrat/lib/webrat/core/mime.rb
  63. +0 −48 vendor/webrat/lib/webrat/core/save_and_open_page.rb
  64. +0 −350 vendor/webrat/lib/webrat/core/scope.rb
  65. +0 −299 vendor/webrat/lib/webrat/core/session.rb
  66. +0 −115 vendor/webrat/lib/webrat/core/xml.rb
  67. +0 −19 vendor/webrat/lib/webrat/core/xml/hpricot.rb
  68. +0 −76 vendor/webrat/lib/webrat/core/xml/nokogiri.rb
  69. +0 −24 vendor/webrat/lib/webrat/core/xml/rexml.rb
  70. +0 −58 vendor/webrat/lib/webrat/core_extensions/blank.rb
  71. +0 −8 vendor/webrat/lib/webrat/core_extensions/deprecate.rb
  72. +0 −12 vendor/webrat/lib/webrat/core_extensions/detect_mapped.rb
  73. +0 −6 vendor/webrat/lib/webrat/core_extensions/meta_class.rb
  74. +0 −5 vendor/webrat/lib/webrat/core_extensions/nil_to_param.rb
  75. +0 −27 vendor/webrat/lib/webrat/core_extensions/tcp_socket.rb
  76. +0 −74 vendor/webrat/lib/webrat/mechanize.rb
  77. +0 −9 vendor/webrat/lib/webrat/merb.rb
  78. +0 −27 vendor/webrat/lib/webrat/merb_multipart_support.rb
  79. +0 −82 vendor/webrat/lib/webrat/merb_session.rb
  80. +0 −25 vendor/webrat/lib/webrat/rack.rb
  81. +0 −106 vendor/webrat/lib/webrat/rails.rb
  82. +0 −10 vendor/webrat/lib/webrat/rspec-rails.rb
  83. +0 −81 vendor/webrat/lib/webrat/selenium.rb
  84. +0 −40 vendor/webrat/lib/webrat/selenium/application_server_factory.rb
  85. +0 −5 vendor/webrat/lib/webrat/selenium/application_servers.rb
  86. +0 −46 vendor/webrat/lib/webrat/selenium/application_servers/base.rb
  87. +0 −26 vendor/webrat/lib/webrat/selenium/application_servers/external.rb
  88. +0 −50 vendor/webrat/lib/webrat/selenium/application_servers/merb.rb
  89. +0 −44 vendor/webrat/lib/webrat/selenium/application_servers/rails.rb
  90. +0 −37 vendor/webrat/lib/webrat/selenium/application_servers/sinatra.rb
  91. +0 −19 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/button.js
  92. +0 −16 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/label.js
  93. +0 −5 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webrat.js
  94. +0 −12 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlink.js
  95. +0 −15 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratlinkwithin.js
  96. +0 −5 vendor/webrat/lib/webrat/selenium/location_strategy_javascript/webratselectwithoption.js
  97. +0 −4 vendor/webrat/lib/webrat/selenium/matchers.rb
  98. +0 −66 vendor/webrat/lib/webrat/selenium/matchers/have_content.rb
  99. +0 −49 vendor/webrat/lib/webrat/selenium/matchers/have_selector.rb
  100. +0 −72 vendor/webrat/lib/webrat/selenium/matchers/have_tag.rb
  101. +0 −45 vendor/webrat/lib/webrat/selenium/matchers/have_xpath.rb
  102. +0 −6 vendor/webrat/lib/webrat/selenium/selenium_extensions.js
  103. +0 −84 vendor/webrat/lib/webrat/selenium/selenium_rc_server.rb
  104. +0 −248 vendor/webrat/lib/webrat/selenium/selenium_session.rb
  105. +0 −18 vendor/webrat/lib/webrat/selenium/silence_stream.rb
  106. +0 −11 vendor/webrat/lib/webrat/sinatra.rb
  107. +0 −34 vendor/webrat/spec/fakes/test_session.rb
  108. +0 −21 vendor/webrat/spec/integration/merb/.gitignore
  109. +0 −35 vendor/webrat/spec/integration/merb/Rakefile
  110. +0 −2 vendor/webrat/spec/integration/merb/app/controllers/application.rb
  111. +0 −13 vendor/webrat/spec/integration/merb/app/controllers/exceptions.rb
  112. +0 −27 vendor/webrat/spec/integration/merb/app/controllers/testing.rb
  113. +0 −63 vendor/webrat/spec/integration/merb/app/views/exceptions/not_acceptable.html.erb
  114. +0 −47 vendor/webrat/spec/integration/merb/app/views/exceptions/not_found.html.erb
  115. +0 −12 vendor/webrat/spec/integration/merb/app/views/layout/application.html.erb
  116. +0 −27 vendor/webrat/spec/integration/merb/app/views/testing/show_form.html.erb
  117. +0 −9 vendor/webrat/spec/integration/merb/app/views/testing/upload.html.erb
  118. +0 −15 vendor/webrat/spec/integration/merb/config/environments/development.rb
  119. +0 −11 vendor/webrat/spec/integration/merb/config/environments/rake.rb
  120. +0 −14 vendor/webrat/spec/integration/merb/config/environments/test.rb
  121. +0 −25 vendor/webrat/spec/integration/merb/config/init.rb
  122. +0 −11 vendor/webrat/spec/integration/merb/config/rack.rb
  123. +0 −34 vendor/webrat/spec/integration/merb/config/router.rb
  124. +0 −1 vendor/webrat/spec/integration/merb/spec/spec.opts
  125. +0 −24 vendor/webrat/spec/integration/merb/spec/spec_helper.rb
  126. +0 −39 vendor/webrat/spec/integration/merb/spec/webrat_spec.rb
  127. +0 −31 vendor/webrat/spec/integration/merb/tasks/merb.thor/app_script.rb
  128. +0 −64 vendor/webrat/spec/integration/merb/tasks/merb.thor/common.rb
  129. +0 −124 vendor/webrat/spec/integration/merb/tasks/merb.thor/gem_ext.rb
  130. +0 −150 vendor/webrat/spec/integration/merb/tasks/merb.thor/main.thor
  131. +0 −93 vendor/webrat/spec/integration/merb/tasks/merb.thor/ops.rb
  132. +0 −40 vendor/webrat/spec/integration/merb/tasks/merb.thor/utils.rb
  133. +0 −5 vendor/webrat/spec/integration/rack/Rakefile
  134. +0 −73 vendor/webrat/spec/integration/rack/app.rb
  135. +0 −20 vendor/webrat/spec/integration/rack/test/helper.rb
  136. +0 −62 vendor/webrat/spec/integration/rack/test/webrat_rack_test.rb
  137. +0 −3 vendor/webrat/spec/integration/rails/.gitignore
  138. +0 −30 vendor/webrat/spec/integration/rails/Rakefile
  139. +0 −15 vendor/webrat/spec/integration/rails/app/controllers/application.rb
  140. +0 −7 vendor/webrat/spec/integration/rails/app/controllers/buttons_controller.rb
  141. +0 −4 vendor/webrat/spec/integration/rails/app/controllers/fields_controller.rb
  142. +0 −7 vendor/webrat/spec/integration/rails/app/controllers/links_controller.rb
  143. +0 −43 vendor/webrat/spec/integration/rails/app/controllers/webrat_controller.rb
  144. +0 −2 vendor/webrat/spec/integration/rails/app/helpers/buttons_helper.rb
  145. +0 −2 vendor/webrat/spec/integration/rails/app/helpers/fields_helper.rb
  146. +0 −2 vendor/webrat/spec/integration/rails/app/helpers/links_helper.rb
  147. +0 −11 vendor/webrat/spec/integration/rails/app/views/buttons/show.html.erb
  148. +0 −9 vendor/webrat/spec/integration/rails/app/views/fields/show.html.erb
  149. +0 −5 vendor/webrat/spec/integration/rails/app/views/links/show.html.erb
  150. +0 −4 vendor/webrat/spec/integration/rails/app/views/webrat/before_redirect_form.html.erb
  151. +0 −11 vendor/webrat/spec/integration/rails/app/views/webrat/buttons.html.erb
  152. +0 −28 vendor/webrat/spec/integration/rails/app/views/webrat/form.html.erb
  153. +0 −109 vendor/webrat/spec/integration/rails/config/boot.rb
  154. +0 −12 vendor/webrat/spec/integration/rails/config/environment.rb
  155. +0 −17 vendor/webrat/spec/integration/rails/config/environments/development.rb
  156. +0 −22 vendor/webrat/spec/integration/rails/config/environments/selenium.rb
  157. +0 −22 vendor/webrat/spec/integration/rails/config/environments/test.rb
  158. +0 −10 vendor/webrat/spec/integration/rails/config/initializers/inflections.rb
  159. +0 −5 vendor/webrat/spec/integration/rails/config/initializers/mime_types.rb
  160. +0 −17 vendor/webrat/spec/integration/rails/config/initializers/new_rails_defaults.rb
  161. +0 −5 vendor/webrat/spec/integration/rails/config/locales/en.yml
  162. +0 −18 vendor/webrat/spec/integration/rails/config/routes.rb
  163. +0 −30 vendor/webrat/spec/integration/rails/public/404.html
  164. +0 −30 vendor/webrat/spec/integration/rails/public/422.html
  165. +0 −33 vendor/webrat/spec/integration/rails/public/500.html
  166. +0 −4 vendor/webrat/spec/integration/rails/script/about
  167. +0 −3 vendor/webrat/spec/integration/rails/script/console
  168. +0 −3 vendor/webrat/spec/integration/rails/script/dbconsole
  169. +0 −3 vendor/webrat/spec/integration/rails/script/destroy
  170. +0 −3 vendor/webrat/spec/integration/rails/script/generate
  171. +0 −3 vendor/webrat/spec/integration/rails/script/performance/benchmarker
  172. +0 −3 vendor/webrat/spec/integration/rails/script/performance/profiler
  173. +0 −3 vendor/webrat/spec/integration/rails/script/performance/request
  174. +0 −3 vendor/webrat/spec/integration/rails/script/plugin
  175. +0 −3 vendor/webrat/spec/integration/rails/script/process/inspector
  176. +0 −3 vendor/webrat/spec/integration/rails/script/process/reaper
  177. +0 −3 vendor/webrat/spec/integration/rails/script/process/spawner
  178. +0 −3 vendor/webrat/spec/integration/rails/script/runner
  179. +0 −3 vendor/webrat/spec/integration/rails/script/server
  180. +0 −80 vendor/webrat/spec/integration/rails/test/integration/button_click_test.rb
  181. +0 −24 vendor/webrat/spec/integration/rails/test/integration/fill_in_test.rb
  182. +0 −27 vendor/webrat/spec/integration/rails/test/integration/link_click_test.rb
  183. +0 −97 vendor/webrat/spec/integration/rails/test/integration/webrat_test.rb
  184. +0 −25 vendor/webrat/spec/integration/rails/test/test_helper.rb
  185. +0 −5 vendor/webrat/spec/integration/sinatra/Rakefile
  186. +0 −64 vendor/webrat/spec/integration/sinatra/classic_app.rb
  187. +0 −16 vendor/webrat/spec/integration/sinatra/modular_app.rb
  188. +0 −37 vendor/webrat/spec/integration/sinatra/test/classic_app_test.rb
  189. +0 −18 vendor/webrat/spec/integration/sinatra/test/modular_app_test.rb
  190. +0 −16 vendor/webrat/spec/integration/sinatra/test/test_helper.rb
  191. +0 −116 vendor/webrat/spec/private/core/configuration_spec.rb
  192. +0 −85 vendor/webrat/spec/private/core/field_spec.rb
  193. +0 −24 vendor/webrat/spec/private/core/link_spec.rb
  194. +0 −10 vendor/webrat/spec/private/core/logging_spec.rb
  195. +0 −195 vendor/webrat/spec/private/core/session_spec.rb
  196. +0 −81 vendor/webrat/spec/private/mechanize/mechanize_session_spec.rb
  197. +0 −93 vendor/webrat/spec/private/merb/attaches_file_spec.rb
  198. +0 −61 vendor/webrat/spec/private/merb/merb_session_spec.rb
  199. +0 −77 vendor/webrat/spec/private/nokogiri_spec.rb
  200. +0 −81 vendor/webrat/spec/private/rails/attaches_file_spec.rb
  201. +0 −112 vendor/webrat/spec/private/rails/rails_session_spec.rb
  202. +0 −26 vendor/webrat/spec/private/selenium/application_servers/rails_spec.rb
  203. +0 −24 vendor/webrat/spec/public/basic_auth_spec.rb
  204. +0 −191 vendor/webrat/spec/public/check_spec.rb
  205. +0 −118 vendor/webrat/spec/public/choose_spec.rb
  206. +0 −106 vendor/webrat/spec/public/click_area_spec.rb
  207. +0 −496 vendor/webrat/spec/public/click_button_spec.rb
  208. +0 −511 vendor/webrat/spec/public/click_link_spec.rb
  209. +0 −209 vendor/webrat/spec/public/fill_in_spec.rb
  210. +0 −19 vendor/webrat/spec/public/locators/field_by_xpath_spec.rb
  211. +0 −172 vendor/webrat/spec/public/locators/field_labeled_spec.rb
  212. +0 −16 vendor/webrat/spec/public/locators/field_with_id_spec.rb
  213. +0 −114 vendor/webrat/spec/public/matchers/contain_spec.rb
  214. +0 −142 vendor/webrat/spec/public/matchers/have_selector_spec.rb
  215. +0 −39 vendor/webrat/spec/public/matchers/have_tag_spec.rb
  216. +0 −136 vendor/webrat/spec/public/matchers/have_xpath_spec.rb
  217. +0 −10 vendor/webrat/spec/public/reload_spec.rb
  218. +0 −70 vendor/webrat/spec/public/save_and_open_spec.rb
  219. +0 −112 vendor/webrat/spec/public/select_date_spec.rb
  220. +0 −137 vendor/webrat/spec/public/select_datetime_spec.rb
  221. +0 −249 vendor/webrat/spec/public/select_spec.rb
  222. +0 −100 vendor/webrat/spec/public/select_time_spec.rb
  223. +0 −49 vendor/webrat/spec/public/selenium/application_server_factory_spec.rb
  224. +0 −12 vendor/webrat/spec/public/selenium/application_servers/external_spec.rb
  225. +0 −37 vendor/webrat/spec/public/selenium/selenium_session_spec.rb
  226. +0 −5 vendor/webrat/spec/public/set_hidden_field_spec.rb
  227. +0 −5 vendor/webrat/spec/public/submit_form_spec.rb
  228. +0 −58 vendor/webrat/spec/public/visit_spec.rb
  229. +0 −177 vendor/webrat/spec/public/within_spec.rb
  230. +0 −1 vendor/webrat/spec/rcov.opts
  231. +0 −2 vendor/webrat/spec/spec.opts
  232. +0 −50 vendor/webrat/spec/spec_helper.rb
View
@@ -3,6 +3,11 @@ Sum
A budgeting app built on Sinatra. Use it at [sumapp.com](http://sumapp.com).
+Compatibility
+-------------
+
+Sum is actively maintained under Ruby 1.9.1.
+
The flow
--------
@@ -16,8 +21,7 @@ Development setup
Install the sum gem for its dependencies:
<pre>
-gem sources -a http://gems.github.com
-sudo gem install winton-sum
+sudo gem install sum --source http://gemcutter.org
</pre>
Fork the [Sum repository](http://github.com/winton/sum) on [GitHub](http://github.com).
@@ -27,12 +31,6 @@ git clone git@github.com:YOUR_NAME/sum.git
cd sum
</pre>
-Create your database:
-
-<pre>
-mysql -uroot -e "create database sum;"
-</pre>
-
Copy and edit the example config files:
<pre>
@@ -41,10 +39,10 @@ cp config/mail.example.yml config/mail.yml
mate config/database.yml config/mail.yml
</pre>
-Migrate the database:
+Create and migrate your database:
<pre>
-rake db:migrate
+rake db:create db:migrate
</pre>
Start the application with shotgun:
@@ -64,6 +62,6 @@ Running the test suite
Sum uses [Cucumber](http://github.com/aslakhellesoy/cucumber), [Webrat](http://github.com/brynary/webrat), and [email-spec](http://github.com/bmabey/email-spec) for functional tests and [rspec](http://github.com/dchelimsky/rspec) for unit tests:
<pre>
-rake features
-rake spec
+cucumber
+spec .
</pre>
View
@@ -1,19 +1,30 @@
require 'rubygems'
+
+gems = [
+ [ 'active_wrapper', '=0.2.2' ],
+ [ 'cucumber', '=0.4.4' ],
+ [ 'rspec', '=1.2.9' ]
+]
+
+gems.each do |name, version|
+ if File.exists?(path = "#{File.dirname(__FILE__)}/../vendor/#{name}/lib")
+ $:.unshift path
+ else
+ gem name, version
+ end
+end
+
require 'rake'
+require 'active_wrapper/tasks'
require 'cucumber/rake/task'
require 'rake/gempackagetask'
require 'spec/rake/spectask'
require 'gemspec'
-begin
- require 'active_wrapper/tasks'
-
- ActiveWrapper::Tasks.new(
- :base => File.dirname(__FILE__),
- :env => ENV['ENV']
- )
-rescue Exception
-end
+ActiveWrapper::Tasks.new(
+ :base => File.dirname(__FILE__),
+ :env => ENV['ENV']
+)
desc "Generate gemspec"
task :gemspec do
View
@@ -1,13 +1,13 @@
-winton-active_wrapper:
+active_wrapper:
repo: git@github.com:winton/active_wrapper.git
path: vendor
email-spec:
repo: git://github.com/bmabey/email-spec.git
path: vendor
-winton-fetcher:
+fetcher:
repo: git@github.com:winton/fetcher.git
path: vendor
-winton-secret_key:
+secret_key:
repo: git@github.com:winton/secret_key.git
path: vendor
sinatra:
View
@@ -10,7 +10,6 @@
key = SecretKey.new(File.dirname(__FILE__)).read
every 1.minute do
- puts @environment
case @environment
when 'development'
command "curl http://localhost:#{@port}/cron"
@@ -10,9 +10,9 @@
When /^I submit a valid form with (.+)$/ do |input|
fill_all_with_valid_data
values = case input
- when "decimals": [ "1000.00", "5000.00", "2000.00" ]
- when "numbers only": [ "1000", "5000", "2000" ]
- when "dollar signs": [ "$1000.00", "$5000.00", "$2000.00" ]
+ when "decimals" then [ "1000.00", "5000.00", "2000.00" ]
+ when "numbers only" then [ "1000", "5000", "2000" ]
+ when "dollar signs" then [ "$1000.00", "$5000.00", "$2000.00" ]
end
fill_in "user[savings]", :with => values.pop
fill_in "user[income]", :with => values.pop
View
@@ -4,22 +4,32 @@
require 'sum'
-gem 'bmabey-email_spec', '=0.2.0'
-gem 'rspec', '=1.2.7'
+gems = [
+ [ 'email_spec', '=0.3.5' ],
+ [ 'rack-test', '=0.5.3' ],
+ [ 'rspec', '=1.2.9' ]
+]
+
+gems.each do |name, version|
+ if File.exists?(path = "#{File.dirname(__FILE__)}/../vendor/#{name}/lib")
+ $:.unshift path
+ else
+ gem name, version
+ end
+end
require 'email_spec'
+require 'email_spec/cucumber'
require 'rack/test'
require 'spec/mocks'
require 'test/unit'
-require "#{$root}/vendor/webrat/lib/webrat"
+require 'webrat'
World do
def app
Application
end
-
- include EmailSpec::Helpers
- include EmailSpec::Matchers
+
include Rack::Test::Methods
include Test::Unit::Assertions
include Webrat::Matchers
View
@@ -21,25 +21,24 @@
s.homepage = "http://github.com/winton/#{GEM_NAME}"
s.summary = "A simple budgeting app built on Sinatra"
# == CONFIGURE ==
- s.add_dependency('bmabey-email_spec', '=0.2.0')
- s.add_dependency('cucumber', '=0.3.93')
- s.add_dependency('haml', '=2.2.2')
- s.add_dependency('less', '=0.8.11')
- s.add_dependency('javan-whenever', '=0.3.6')
- s.add_dependency('rack', '=1.0.0')
- s.add_dependency('rack-test', '=0.4.0')
- s.add_dependency('rspec', '=1.2.8')
- s.add_dependency('shotgun', '=0.3')
+ s.add_dependency('active_wrapper', '=0.2.2')
+ s.add_dependency('email_spec', '=0.3.5')
+ s.add_dependency('cucumber', '=0.4.4')
+ s.add_dependency('haml', '=2.2.14')
+ s.add_dependency('less', '=1.2.17')
+ s.add_dependency('whenever', '=0.4.0')
+ s.add_dependency('rack', '=1.0.1')
+ s.add_dependency('rack-test', '=0.5.3')
+ s.add_dependency('rspec', '=1.2.9')
+ s.add_dependency('secret_key', '=0.1.0')
+ s.add_dependency('shotgun', '=0.4')
s.add_dependency('sinatra', '=0.9.4')
- s.add_dependency('winton-active_wrapper', '=0.1.9')
- s.add_dependency('winton-externals', '=1.0.2')
- s.add_dependency('winton-fetcher', '=0.1.2')
- s.add_dependency('winton-secret_key', '=0.1.0')
+ s.add_dependency('webrat', '=0.6.0')
s.extra_rdoc_files = [ "README.markdown" ]
s.files = GEM_FILES.to_a
s.has_rdoc = false
s.name = GEM_NAME
s.platform = Gem::Platform::RUBY
s.require_path = "lib"
- s.version = "0.1.1"
+ s.version = "0.1.2"
end
View
@@ -1,18 +1,18 @@
require 'rubygems'
gems = [
- [ 'haml', '=2.2.2' ],
- [ 'sinatra', '=0.9.4' ],
- [ 'winton-active_wrapper', '=0.1.9' ],
- [ 'winton-fetcher', '=0.1.2' ],
- [ 'winton-secret_key', '=0.1.0' ]
+ [ 'active_wrapper', '=0.2.2' ],
+ [ 'fetcher', '=0.1.2' ],
+ [ 'haml', '=2.2.14' ],
+ [ 'secret_key', '=0.1.0' ],
+ [ 'sinatra', '=0.9.4' ]
]
gems.each do |name, version|
- begin
+ if File.exists?(path = "#{File.dirname(__FILE__)}/../vendor/#{name}/lib")
+ $:.unshift path
+ else
gem name, version
- rescue Exception
- $:.unshift "#{File.dirname(__FILE__)}/../vendor/#{name}/lib"
end
end
View
@@ -2,7 +2,7 @@
helpers do
def days(day)
- day <= 1 ? "day" : "#{day} days"
+ day <= 1 ? "day" : "#{day.to_i} days"
end
def money(amount)
View
@@ -118,7 +118,7 @@ def beginning_of_month
# Days in this fiscal month
def days_in_month
- self.reset_at.to_date - self.beginning_of_month.to_date
+ (self.reset_at.to_date - self.beginning_of_month.to_date).to_i
end
# Days left in this fiscal month
@@ -138,7 +138,7 @@ def days_passed
# Days passed in this fiscal month, including today
def days_passed_including_today
- self.days_passed + 1
+ (self.days_passed + 1).to_i
end
# Reset spent_today
@@ -199,7 +199,7 @@ def spending_goal_today_savings
# How much the user is spending per day (ideally)
def spending_per_day
- self.spending_goal / self.days_in_month
+ self.spending_goal / self.days_in_month.to_f
end
# How much the user has spent this month
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1 @@
+.DS_Store
View
@@ -0,0 +1,20 @@
+Copyright (c) 2007 Dan Weinand and Slantwise Design, LLC
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
@@ -0,0 +1,94 @@
+= Fetcher
+
+Fetcher is a simple message fetcher perfect for using in a daemon or via cron.
+
+It implements the following common pattern:
+
+1. Connect to a server
+2. Download available messages
+3. Send each message to another object for further processing
+4. Remove downloaded messages from the remote server
+
+Install using:
+
+ sudo gem install winton-fetcher
+
+== Notice
+
+This is a fork of {fetcher}[http://github.com/look/fetcher] by {Luke Francl}[http://github.com/look].
+
+Differences:
+
+* Gemified
+* Doesn't have generators
+* Fixes a connection exception issue
+
+== Usage
+
+Create a new fetcher object like the following:
+
+ @fetcher = Fetcher.create({:type => :pop,
+ :receiver => IncomingMailHandler,
+ :server => 'mail.example.com',
+ :username => 'jim',
+ :password => 'test'})
+
+The receiver object is expected to have a receive method that takes a message as its only argument
+(e.g., the way <tt>ActionMailer::Base.recieve</tt> works; but you don't <em>have</em> to use ActionMailer.).
+
+Call <tt>fetch</tt> to download messages and process them.
+
+ @fetcher.fetch
+
+== Configuration
+
+The following options can be passed to the <tt>Fetcher.create</tt> factory method:
+
+[<tt>type</tt>] POP or IMAP
+[<tt>server</tt>] The IP address or domain name of the server
+[<tt>port</tt>] The port to connect to (defaults to the standard port for the type of server)
+[<tt>ssl</tt>] Set to any value to use SSL encryption
+[<tt>username</tt>] The username used to connect to the server
+[<tt>password</tt>] The password used to connect to the server
+[<tt>authentication</tt>] The authentication scheme to use (IMAP only). Supports LOGIN, CRAM-MD5, and PASSWORD (defaults to PLAIN)
+[<tt>use_login</tt>] Set to any value to use the LOGIN command instead of AUTHENTICATE. Some servers, like GMail, do not support AUTHENTICATE (IMAP only).
+[<tt>sleep_time</tt>] The number of seconds to sleep between fetches (defaults to 60 seconds; valid only for the generated daemon)
+[<tt>processed_folder</tt>] The name of a folder to move mail to after it has been processed (IMAP only). <b>NOTE:</b> If not specified, mail is deleted.
+[<tt>error_folder</tt>] The name a folder to move mail that causes an error during processing (IMAP only). Defaults to +bogus+.
+
+== Running via cron
+
+You can also run the Fetcher periodically via cron. It is important to ensure that only one
+instance is running at one time, and for that the {Lockfile gem}[http://codeforpeople.com/lib/ruby/lockfile/] is recommended.
+
+Here is an example script to be with <tt>script/runner</tt> via cron:
+
+ begin
+ Lockfile.new('cron_mail_fetcher.lock', :retries => 0) do
+ config = YAML.load_file("#{RAILS_ROOT}/config/mail.yml")
+ config = config[RAILS_ENV].to_options
+
+ fetcher = Fetcher.create({:receiver => MailReceiver}.merge(config))
+ fetcher.fetch
+ end
+ rescue Lockfile::MaxTriesLockError => e
+ puts "Another fetcher is already running. Exiting."
+ end
+
+== Extending
+
+You can subclass <tt>Fetcher::Base</tt> or one of the protocol-specific classed to override the standard behavior.
+
+== Further documentation
+
+<shameless-plug>
+
+You can read more about how to use the Fetcher in the PeepCode book {Receiving Email with Ruby}[https://peepcode.com/products/mms2r-pdf].
+
+</shameless-plug>
+
+== Credit & Copyright
+
+Created by Dan Weinand and Luke Francl. Development supported by {Slantwise Design}[http://slantwisedesign.com].
+
+Licensed under the terms of the MIT License. Be excellent to each other.
Oops, something went wrong.

0 comments on commit 8880b19

Please sign in to comment.