Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bundle this up

  • Loading branch information...
commit 3370b09d445668821d96ca736b205e28744a9df2 1 parent e3f5554
@qrush qrush authored
Showing with 65 additions and 13,127 deletions.
  1. +2 −0  .gitignore
  2. +24 −0 Gemfile
  3. +3 −0  bin/convert_to_should_syntax
  4. +3 −0  bin/cucumber
  5. +3 −0  bin/htmldiff
  6. +3 −0  bin/ldiff
  7. +3 −0  bin/nokogiri
  8. +3 −0  bin/rackup
  9. +3 −0  bin/rails
  10. +3 −0  bin/rake
  11. +3 −0  bin/rg
  12. +3 −0  bin/s3sh
  13. +3 −0  bin/tt
  14. +6 −35 config/environment.rb
  15. +0 −5 config/initializers/clearance.rb
  16. BIN  vendor/bundler_gems/cache/actionmailer-2.3.4.gem
  17. BIN  vendor/bundler_gems/cache/actionpack-2.3.4.gem
  18. BIN  vendor/bundler_gems/cache/activerecord-2.3.4.gem
  19. BIN  vendor/bundler_gems/cache/activeresource-2.3.4.gem
  20. BIN  vendor/bundler_gems/cache/activesupport-2.3.4.gem
  21. BIN  vendor/bundler_gems/cache/ambethia-smtp-tls-1.1.2.gem
  22. BIN  vendor/bundler_gems/cache/aws-s3-0.6.2.gem
  23. BIN  vendor/bundler_gems/cache/builder-2.1.2.gem
  24. BIN  vendor/bundler_gems/cache/clearance-0.8.2.gem
  25. BIN  vendor/bundler_gems/cache/cucumber-0.3.101.gem
  26. BIN  vendor/bundler_gems/cache/ddollar-pacecar-1.1.6.gem
  27. BIN  vendor/bundler_gems/cache/diff-lcs-1.1.2.gem
  28. BIN  vendor/bundler_gems/cache/factory_girl-1.2.2.gem
  29. BIN  vendor/bundler_gems/cache/fakeweb-1.2.6.gem
  30. BIN  vendor/bundler_gems/cache/memcache-client-1.7.5.gem
  31. BIN  vendor/bundler_gems/cache/mime-types-1.16.gem
  32. BIN  vendor/bundler_gems/cache/nokogiri-1.3.3.gem
  33. BIN  vendor/bundler_gems/cache/polyglot-0.2.9.gem
  34. BIN  vendor/bundler_gems/cache/rack-1.0.0.gem
  35. BIN  vendor/bundler_gems/cache/rack-cache-0.5.2.gem
  36. BIN  vendor/bundler_gems/cache/rack-test-0.5.0.gem
  37. BIN  vendor/bundler_gems/cache/rails-2.3.4.gem
  38. BIN  vendor/bundler_gems/cache/rake-0.8.7.gem
  39. BIN  vendor/bundler_gems/cache/redgreen-1.2.2.gem
  40. BIN  vendor/bundler_gems/cache/rr-0.10.4.gem
  41. BIN  vendor/bundler_gems/cache/shoulda-2.10.2.gem
  42. BIN  vendor/bundler_gems/cache/term-ansicolor-1.0.4.gem
  43. BIN  vendor/bundler_gems/cache/treetop-1.4.2.gem
  44. BIN  vendor/bundler_gems/cache/webrat-0.5.3.gem
  45. BIN  vendor/bundler_gems/cache/will_paginate-2.3.11.gem
  46. BIN  vendor/bundler_gems/cache/xml-simple-1.0.12.gem
  47. +0 −60 vendor/gems/ambethia-smtp-tls-1.1.2/.specification
  48. +0 −18 vendor/gems/ambethia-smtp-tls-1.1.2/README.rdoc
  49. +0 −4 vendor/gems/ambethia-smtp-tls-1.1.2/VERSION.yml
  50. +0 −70 vendor/gems/ambethia-smtp-tls-1.1.2/lib/smtp-tls.rb
  51. +0 −175 vendor/gems/aws-s3-0.6.2/.specification
  52. +0 −19 vendor/gems/aws-s3-0.6.2/COPYING
  53. +0 −55 vendor/gems/aws-s3-0.6.2/INSTALL
  54. +0 −545 vendor/gems/aws-s3-0.6.2/README
  55. +0 −334 vendor/gems/aws-s3-0.6.2/Rakefile
  56. +0 −6 vendor/gems/aws-s3-0.6.2/bin/s3sh
  57. +0 −10 vendor/gems/aws-s3-0.6.2/bin/setup.rb
  58. +0 −60 vendor/gems/aws-s3-0.6.2/lib/aws/s3.rb
  59. +0 −636 vendor/gems/aws-s3-0.6.2/lib/aws/s3/acl.rb
  60. +0 −221 vendor/gems/aws-s3-0.6.2/lib/aws/s3/authentication.rb
  61. +0 −240 vendor/gems/aws-s3-0.6.2/lib/aws/s3/base.rb
  62. +0 −58 vendor/gems/aws-s3-0.6.2/lib/aws/s3/bittorrent.rb
  63. +0 −319 vendor/gems/aws-s3-0.6.2/lib/aws/s3/bucket.rb
  64. +0 −278 vendor/gems/aws-s3-0.6.2/lib/aws/s3/connection.rb
  65. +0 −69 vendor/gems/aws-s3-0.6.2/lib/aws/s3/error.rb
  66. +0 −133 vendor/gems/aws-s3-0.6.2/lib/aws/s3/exceptions.rb
  67. +0 −356 vendor/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb
  68. +0 −314 vendor/gems/aws-s3-0.6.2/lib/aws/s3/logging.rb
  69. +0 −612 vendor/gems/aws-s3-0.6.2/lib/aws/s3/object.rb
  70. +0 −44 vendor/gems/aws-s3-0.6.2/lib/aws/s3/owner.rb
  71. +0 −99 vendor/gems/aws-s3-0.6.2/lib/aws/s3/parsing.rb
  72. +0 −180 vendor/gems/aws-s3-0.6.2/lib/aws/s3/response.rb
  73. +0 −51 vendor/gems/aws-s3-0.6.2/lib/aws/s3/service.rb
  74. +0 −12 vendor/gems/aws-s3-0.6.2/lib/aws/s3/version.rb
  75. +0 −187 vendor/gems/aws-s3-0.6.2/support/faster-xml-simple/lib/faster_xml_simple.rb
  76. +0 −47 vendor/gems/aws-s3-0.6.2/support/faster-xml-simple/test/regression_test.rb
  77. +0 −17 vendor/gems/aws-s3-0.6.2/support/faster-xml-simple/test/test_helper.rb
  78. +0 −46 vendor/gems/aws-s3-0.6.2/support/faster-xml-simple/test/xml_simple_comparison_test.rb
  79. +0 −211 vendor/gems/aws-s3-0.6.2/support/rdoc/code_info.rb
  80. +0 −254 vendor/gems/aws-s3-0.6.2/test/acl_test.rb
  81. +0 −114 vendor/gems/aws-s3-0.6.2/test/authentication_test.rb
  82. +0 −136 vendor/gems/aws-s3-0.6.2/test/base_test.rb
  83. +0 −74 vendor/gems/aws-s3-0.6.2/test/bucket_test.rb
  84. +0 −215 vendor/gems/aws-s3-0.6.2/test/connection_test.rb
  85. +0 −70 vendor/gems/aws-s3-0.6.2/test/error_test.rb
  86. +0 −340 vendor/gems/aws-s3-0.6.2/test/extensions_test.rb
  87. +0 −89 vendor/gems/aws-s3-0.6.2/test/fixtures.rb
  88. +0 −133 vendor/gems/aws-s3-0.6.2/test/fixtures/buckets.yml
  89. +0 −34 vendor/gems/aws-s3-0.6.2/test/fixtures/errors.yml
  90. +0 −3  vendor/gems/aws-s3-0.6.2/test/fixtures/headers.yml
  91. +0 −15 vendor/gems/aws-s3-0.6.2/test/fixtures/logging.yml
  92. +0 −5 vendor/gems/aws-s3-0.6.2/test/fixtures/loglines.yml
  93. +0 −7 vendor/gems/aws-s3-0.6.2/test/fixtures/logs.yml
  94. +0 −16 vendor/gems/aws-s3-0.6.2/test/fixtures/policies.yml
  95. +0 −89 vendor/gems/aws-s3-0.6.2/test/logging_test.rb
  96. +0 −26 vendor/gems/aws-s3-0.6.2/test/mocks/fake_response.rb
  97. +0 −205 vendor/gems/aws-s3-0.6.2/test/object_test.rb
  98. +0 −66 vendor/gems/aws-s3-0.6.2/test/parsing_test.rb
  99. +0 −117 vendor/gems/aws-s3-0.6.2/test/remote/acl_test.rb
  100. +0 −45 vendor/gems/aws-s3-0.6.2/test/remote/bittorrent_test.rb
  101. +0 −146 vendor/gems/aws-s3-0.6.2/test/remote/bucket_test.rb
  102. +0 −82 vendor/gems/aws-s3-0.6.2/test/remote/logging_test.rb
  103. +0 −371 vendor/gems/aws-s3-0.6.2/test/remote/object_test.rb
  104. BIN  vendor/gems/aws-s3-0.6.2/test/remote/test_file.data
  105. +0 −33 vendor/gems/aws-s3-0.6.2/test/remote/test_helper.rb
  106. +0 −68 vendor/gems/aws-s3-0.6.2/test/response_test.rb
  107. +0 −23 vendor/gems/aws-s3-0.6.2/test/service_test.rb
  108. +0 −110 vendor/gems/aws-s3-0.6.2/test/test_helper.rb
  109. +0 −562 vendor/gems/cucumber-0.3.101/.specification
  110. +0 −1,066 vendor/gems/cucumber-0.3.101/History.txt
  111. +0 −22 vendor/gems/cucumber-0.3.101/License.txt
  112. +0 −453 vendor/gems/cucumber-0.3.101/Manifest.txt
  113. +0 −4 vendor/gems/cucumber-0.3.101/README.txt
  114. +0 −9 vendor/gems/cucumber-0.3.101/Rakefile
  115. +0 −17 vendor/gems/cucumber-0.3.101/bin/cucumber
  116. +0 −78 vendor/gems/cucumber-0.3.101/config/hoe.rb
  117. +0 −15 vendor/gems/cucumber-0.3.101/config/requirements.rb
  118. +0 −2  vendor/gems/cucumber-0.3.101/cucumber.yml
  119. +0 −1  vendor/gems/cucumber-0.3.101/examples/cs/README.textile
  120. +0 −12 vendor/gems/cucumber-0.3.101/examples/cs/Rakefile
  121. +0 −1  vendor/gems/cucumber-0.3.101/examples/cs/compile.bat
  122. +0 −16 vendor/gems/cucumber-0.3.101/examples/cs/features/addition.feature
  123. +0 −19 vendor/gems/cucumber-0.3.101/examples/cs/features/step_definitons/calculator_steps.rb
  124. +0 −20 vendor/gems/cucumber-0.3.101/examples/cs/src/demo/Calculator.cs
  125. +0 −6 vendor/gems/cucumber-0.3.101/examples/dos_line_endings/Rakefile
  126. +0 −9 vendor/gems/cucumber-0.3.101/examples/dos_line_endings/features/dos_line_endings.feature
  127. +0 −18 vendor/gems/cucumber-0.3.101/examples/i18n/README.textile
  128. +0 −32 vendor/gems/cucumber-0.3.101/examples/i18n/Rakefile
  129. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/ar/Rakefile
  130. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/ar/features/addition.feature
  131. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/ar/features/step_definitons/calculator_steps.rb
  132. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/ar/lib/calculator.rb
  133. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/bg/Rakefile
  134. +0 −12 vendor/gems/cucumber-0.3.101/examples/i18n/bg/features/addition.feature
  135. +0 −19 vendor/gems/cucumber-0.3.101/examples/i18n/bg/features/consecutive_calculations.feature
  136. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/bg/features/division.feature
  137. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/bg/features/step_definitons/calculator_steps.rb
  138. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/bg/features/support/env.rb
  139. +0 −8 vendor/gems/cucumber-0.3.101/examples/i18n/bg/features/support/world.rb
  140. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/bg/lib/calculator.rb
  141. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/cat/Rakefile
  142. +0 −21 vendor/gems/cucumber-0.3.101/examples/i18n/cat/features/step_definitons/calculator_steps.rb
  143. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/cat/features/suma.feature
  144. +0 −16 vendor/gems/cucumber-0.3.101/examples/i18n/cat/lib/calculadora.rb
  145. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/da/Rakefile
  146. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/da/features/step_definitons/kalkulator_steps.rb
  147. +0 −18 vendor/gems/cucumber-0.3.101/examples/i18n/da/features/summering.feature
  148. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/da/lib/kalkulator.rb
  149. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/de/Rakefile
  150. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/de/features/addition.feature
  151. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/de/features/division.feature
  152. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/de/features/step_definitons/calculator_steps.rb
  153. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/de/lib/calculator.rb
  154. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/en-lol/Rakefile
  155. +0 −16 vendor/gems/cucumber-0.3.101/examples/i18n/en-lol/features/step_definitions/cucumbrz_steps.rb
  156. +0 −8 vendor/gems/cucumber-0.3.101/examples/i18n/en-lol/features/stuffing.feature
  157. +0 −8 vendor/gems/cucumber-0.3.101/examples/i18n/en-lol/features/support/env.rb
  158. +0 −12 vendor/gems/cucumber-0.3.101/examples/i18n/en-lol/lib/basket.rb
  159. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/en-lol/lib/belly.rb
  160. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/en/Rakefile
  161. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/en/features/addition.feature
  162. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/en/features/division.feature
  163. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/en/features/step_definitons/calculator_steps.rb
  164. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/en/lib/calculator.rb
  165. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/es/Rakefile
  166. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/es/features/adicion.feature
  167. +0 −21 vendor/gems/cucumber-0.3.101/examples/i18n/es/features/step_definitons/calculador_steps.rb
  168. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/es/lib/calculador.rb
  169. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/et/Rakefile
  170. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/et/features/jagamine.feature
  171. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/et/features/liitmine.feature
  172. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/et/features/step_definitions/kalkulaator_steps.rb
  173. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/et/lib/kalkulaator.rb
  174. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/fi/Rakefile
  175. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/fi/features/jakolasku.feature
  176. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/fi/features/step_definitons/laskin_steps.rb
  177. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/fi/features/yhteenlasku.feature
  178. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/fi/lib/laskin.rb
  179. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/fr/Rakefile
  180. +0 −18 vendor/gems/cucumber-0.3.101/examples/i18n/fr/features/addition.feature
  181. +0 −25 vendor/gems/cucumber-0.3.101/examples/i18n/fr/features/step_definitions/calculatrice_steps.rb
  182. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/fr/lib/calculatrice.rb
  183. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/he/Rakefile
  184. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/he/features/addition.feature
  185. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/he/features/division.feature
  186. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/he/features/step_definitons/calculator_steps.rb
  187. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/he/lib/calculator.rb
  188. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/hu/Rakefile
  189. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/hu/features/addition.feature
  190. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/hu/features/division.feature
  191. +0 −25 vendor/gems/cucumber-0.3.101/examples/i18n/hu/features/step_definitons/calculator_steps.rb
  192. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/hu/lib/calculator.rb
  193. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/id/Rakefile
  194. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/id/features/addition.feature
  195. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/id/features/division.feature
  196. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/id/features/step_definitons/calculator_steps.rb
  197. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/id/lib/calculator.rb
  198. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/it/Rakefile
  199. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/it/features/somma.feature
  200. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/it/features/step_definitons/calcolatrice_steps.rb
  201. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/it/lib/calcolatrice.rb
  202. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/ja/Rakefile
  203. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/ja/features/addition.feature
  204. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/ja/features/division.feature
  205. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/ja/features/step_definitons/calculator_steps.rb
  206. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/ja/lib/calculator.rb
  207. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/ko/Rakefile
  208. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/ko/features/addition.feature
  209. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/ko/features/division.feature
  210. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/ko/features/step_definitons/calculator_steps.rb
  211. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/ko/lib/calculator.rb
  212. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/lt/Rakefile
  213. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/lt/features/addition.feature
  214. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/lt/features/division.feature
  215. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/lt/features/step_definitons/calculator_steps.rb
  216. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/lt/lib/calculator.rb
  217. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/lv/Rakefile
  218. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/lv/features/addition.feature
  219. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/lv/features/division.feature
  220. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/lv/features/step_definitons/calculator_steps.rb
  221. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/lv/lib/calculator.rb
  222. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/no/Rakefile
  223. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/no/features/step_definitons/kalkulator_steps.rb
  224. +0 −19 vendor/gems/cucumber-0.3.101/examples/i18n/no/features/summering.feature
  225. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/no/features/support/env.rb
  226. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/no/lib/kalkulator.rb
  227. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/pl/Rakefile
  228. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/pl/features/addition.feature
  229. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/pl/features/division.feature
  230. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/pl/features/step_definitons/calculator_steps.rb
  231. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/pl/features/support/env.rb
  232. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/pl/lib/calculator.rb
  233. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/pt/Rakefile
  234. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/pt/features/adicao.feature
  235. +0 −20 vendor/gems/cucumber-0.3.101/examples/i18n/pt/features/step_definitions/calculadora_steps.rb
  236. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/pt/features/support/env.rb
  237. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/pt/lib/calculadora.rb
  238. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/ro/Rakefile
  239. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/ro/features/step_definitons/calculator_steps.rb
  240. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/ro/features/suma.feature
  241. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/ro/lib/calculator.rb
  242. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/ru/Rakefile
  243. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/ru/features/addition.feature
  244. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/ru/features/consecutive_calculations.feature
  245. +0 −16 vendor/gems/cucumber-0.3.101/examples/i18n/ru/features/division.feature
  246. +0 −19 vendor/gems/cucumber-0.3.101/examples/i18n/ru/features/step_definitons/calculator_steps.rb
  247. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/ru/features/support/env.rb
  248. +0 −8 vendor/gems/cucumber-0.3.101/examples/i18n/ru/features/support/world.rb
  249. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/ru/lib/calculator.rb
  250. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/se/Rakefile
  251. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/se/features/step_definitons/kalkulator_steps.rb
  252. +0 −18 vendor/gems/cucumber-0.3.101/examples/i18n/se/features/summering.feature
  253. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/se/lib/kalkulator.rb
  254. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/sk/Rakefile
  255. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/sk/features/addition.feature
  256. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/sk/features/division.feature
  257. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/sk/features/step_definitons/calculator_steps.rb
  258. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/sk/lib/calculator.rb
  259. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/uz/Rakefile
  260. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/uz/features/addition.feature
  261. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/uz/features/consecutive_calculations.feature
  262. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/uz/features/division.feature
  263. +0 −19 vendor/gems/cucumber-0.3.101/examples/i18n/uz/features/step_definitons/calculator_steps.rb
  264. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/uz/features/support/env.rb
  265. +0 −8 vendor/gems/cucumber-0.3.101/examples/i18n/uz/features/support/world.rb
  266. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/uz/lib/calculator.rb
  267. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/zh-CN/Rakefile
  268. +0 −18 vendor/gems/cucumber-0.3.101/examples/i18n/zh-CN/features/addition.feature
  269. +0 −26 vendor/gems/cucumber-0.3.101/examples/i18n/zh-CN/features/step_definitons/calculator_steps.rb
  270. +0 −10 vendor/gems/cucumber-0.3.101/examples/i18n/zh-CN/lib/calculator.rb
  271. +0 −6 vendor/gems/cucumber-0.3.101/examples/i18n/zh-TW/Rakefile
  272. +0 −17 vendor/gems/cucumber-0.3.101/examples/i18n/zh-TW/features/addition.feature
  273. +0 −11 vendor/gems/cucumber-0.3.101/examples/i18n/zh-TW/features/division.feature
  274. +0 −24 vendor/gems/cucumber-0.3.101/examples/i18n/zh-TW/features/step_definitons/calculator_steps.rb
  275. +0 −14 vendor/gems/cucumber-0.3.101/examples/i18n/zh-TW/lib/calculator.rb
  276. +0 −18 vendor/gems/cucumber-0.3.101/examples/java/README.textile
  277. +0 −33 vendor/gems/cucumber-0.3.101/examples/java/build.xml
  278. +0 −11 vendor/gems/cucumber-0.3.101/examples/java/features/hello.feature
  279. +0 −23 vendor/gems/cucumber-0.3.101/examples/java/features/step_definitons/hello_steps.rb
  280. +0 −14 vendor/gems/cucumber-0.3.101/examples/java/features/step_definitons/tree_steps.rb
  281. +0 −9 vendor/gems/cucumber-0.3.101/examples/java/features/tree.feature
  282. +0 −16 vendor/gems/cucumber-0.3.101/examples/java/src/cucumber/demo/Hello.java
  283. +0 −8 vendor/gems/cucumber-0.3.101/examples/junit/features/one_passing_one_failing.feature
  284. +0 −5 vendor/gems/cucumber-0.3.101/examples/junit/features/pending.feature
  285. +0 −11 vendor/gems/cucumber-0.3.101/examples/junit/features/step_definitions/steps.rb
  286. +0 −5 vendor/gems/cucumber-0.3.101/examples/pure_java/README.textile
  287. +0 −19 vendor/gems/cucumber-0.3.101/examples/python/features/fibonacci.feature
  288. +0 −3  vendor/gems/cucumber-0.3.101/examples/python/features/step_definitions/fib_steps.py
  289. +0 −7 vendor/gems/cucumber-0.3.101/examples/python/features/step_definitions/fib_steps.rb
  290. +0 −21 vendor/gems/cucumber-0.3.101/examples/python/features/support/env.rb
  291. +0 −7 vendor/gems/cucumber-0.3.101/examples/python/lib/fib.py
  292. +0 −6 vendor/gems/cucumber-0.3.101/examples/selenium/Rakefile
  293. +0 −9 vendor/gems/cucumber-0.3.101/examples/selenium/features/search.feature
  294. +0 −13 vendor/gems/cucumber-0.3.101/examples/selenium/features/step_definitons/search_steps.rb
  295. +0 −19 vendor/gems/cucumber-0.3.101/examples/selenium/features/support/env.rb
  296. +0 −6 vendor/gems/cucumber-0.3.101/examples/selenium_webrat/Rakefile
  297. 0  vendor/gems/cucumber-0.3.101/examples/selenium_webrat/config.ru
  298. +0 −9 vendor/gems/cucumber-0.3.101/examples/selenium_webrat/features/search.feature
  299. +0 −13 vendor/gems/cucumber-0.3.101/examples/selenium_webrat/features/step_definitons/search_steps.rb
  300. +0 −45 vendor/gems/cucumber-0.3.101/examples/selenium_webrat/features/support/env.rb
Sorry, we could not display the entire diff because too many files (945) changed.
View
2  .gitignore
@@ -11,3 +11,5 @@ db/*.sqlite3
config/database.yml
*.sql
_site/
+vendor/bundler_gems/
+!vendor/bundler_gems/cache/
View
24 Gemfile
@@ -0,0 +1,24 @@
+clear_sources
+bundle_path "vendor/bundler_gems"
+
+source "http://gemcutter.org"
+source "http://gems.github.com"
+
+gem "rails", "2.3.4", :only => :bundle
+gem "clearance"
+gem "will_paginate"
+gem "ddollar-pacecar", "1.1.6", :require_as => "pacecar"
+
+gem "shoulda", :only => :test
+gem "factory_girl", :only => :test
+gem "webrat", :only => :test
+gem "cucumber", "0.3.101", :only => :test
+gem "rr", :only => :test
+gem "redgreen", :only => :test
+gem "fakeweb", :only => :test
+gem "rack-test", :only => :test, :require_as => "rack/test"
+
+gem "rack-cache", :require_as => "rack/cache", :only => :production
+gem "aws-s3", :require_as => "aws/s3", :only => :production
+gem "ambethia-smtp-tls", :require_as => "smtp-tls", :only => :production
+gem "memcache-client", :require_as => "memcache", :only => :production
View
3  bin/convert_to_should_syntax
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/shoulda-2.10.2/bin/convert_to_should_syntax")
View
3  bin/cucumber
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/cucumber-0.3.101/bin/cucumber")
View
3  bin/htmldiff
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/diff-lcs-1.1.2/bin/htmldiff")
View
3  bin/ldiff
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/diff-lcs-1.1.2/bin/ldiff")
View
3  bin/nokogiri
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/nokogiri-1.3.3/bin/nokogiri")
View
3  bin/rackup
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/rack-1.0.0/bin/rackup")
View
3  bin/rails
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/rails-2.3.4/bin/rails")
View
3  bin/rake
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/rake-0.8.7/bin/rake")
View
3  bin/rg
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/redgreen-1.2.2/bin/rg")
View
3  bin/s3sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/aws-s3-0.6.2/bin/s3sh")
View
3  bin/tt
@@ -0,0 +1,3 @@
+#!/usr/bin/env ruby
+require File.join(File.dirname(__FILE__), "../vendor/bundler_gems/environment")
+load File.join(File.dirname(__FILE__), "../vendor/bundler_gems/gems/treetop-1.4.2/bin/tt")
View
41 config/environment.rb
@@ -1,51 +1,22 @@
RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
+require "#{RAILS_ROOT}/vendor/bundler_gems/environment"
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
-
- config.gem "thoughtbot-clearance",
- :lib => 'clearance',
- :source => 'http://gems.github.com',
- :version => '0.8.2'
- config.gem "ddollar-pacecar",
- :lib => 'pacecar',
- :source => 'http://gems.github.com',
- :version => '1.1.6'
- config.gem 'mislav-will_paginate',
- :version => '~> 2.3.11',
- :lib => 'will_paginate',
- :source => 'http://gems.github.com'
- config.gem 'aws-s3',
- :version => '0.6.2',
- :lib => 'aws/s3'
- config.gem "ambethia-smtp-tls",
- :lib => "smtp-tls",
- :version => "1.1.2",
- :source => "http://gems.github.com"
- config.gem "memcache-client",
- :lib => "memcache",
- :version => "1.7.2"
- config.gem "rtomayko-rack-cache",
- :lib => "rack/cache",
- :version => "0.5.1"
- config.gem "gchartrb",
- :lib => "google_chart"
- config.gem "sinatra"
-
config.action_mailer.delivery_method = :smtp
end
+Bundler.require_env
+
DO_NOT_REPLY = "donotreply@gemcutter.org"
require 'lib/indexer'
require 'lib/core_ext/string'
-
-Gem.configuration.verbose = false
-ActiveRecord::Base.include_root_in_json = false
-
require 'clearance/sessions_controller'
-
require 'rdoc/markup/simple_markup'
require 'rdoc/markup/simple_markup/to_html'
+
+Gem.configuration.verbose = false
+ActiveRecord::Base.include_root_in_json = false
View
5 config/initializers/clearance.rb
@@ -1,5 +0,0 @@
-# Really not sure why this is necessary.
-require 'vendor/gems/thoughtbot-clearance-0.8.2/app/controllers/clearance/confirmations_controller'
-require 'vendor/gems/thoughtbot-clearance-0.8.2/app/controllers/clearance/passwords_controller'
-require 'vendor/gems/thoughtbot-clearance-0.8.2/app/controllers/clearance/sessions_controller'
-require 'vendor/gems/thoughtbot-clearance-0.8.2/app/controllers/clearance/users_controller'
View
BIN  vendor/bundler_gems/cache/actionmailer-2.3.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/actionpack-2.3.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/activerecord-2.3.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/activeresource-2.3.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/activesupport-2.3.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/ambethia-smtp-tls-1.1.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/aws-s3-0.6.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/builder-2.1.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/clearance-0.8.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/cucumber-0.3.101.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/ddollar-pacecar-1.1.6.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/diff-lcs-1.1.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/factory_girl-1.2.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/fakeweb-1.2.6.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/memcache-client-1.7.5.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/mime-types-1.16.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/nokogiri-1.3.3.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/polyglot-0.2.9.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/rack-1.0.0.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/rack-cache-0.5.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/rack-test-0.5.0.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/rails-2.3.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/rake-0.8.7.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/redgreen-1.2.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/rr-0.10.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/shoulda-2.10.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/term-ansicolor-1.0.4.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/treetop-1.4.2.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/webrat-0.5.3.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/will_paginate-2.3.11.gem
Binary file not shown
View
BIN  vendor/bundler_gems/cache/xml-simple-1.0.12.gem
Binary file not shown
View
60 vendor/gems/ambethia-smtp-tls-1.1.2/.specification
@@ -1,60 +0,0 @@
---- !ruby/object:Gem::Specification
-name: ambethia-smtp-tls
-version: !ruby/object:Gem::Version
- version: 1.1.2
-platform: ruby
-authors:
-- Unknown
-- Jason L Perry
-- Elliot Cable
-autorequire:
-bindir: bin
-cert_chain: []
-
-date: 2009-04-02 00:00:00 -04:00
-default_executable:
-dependencies: []
-
-description: A gem package for the SMTP TLS code that's been floating around for years
-email: jasper@ambethia.com
-executables: []
-
-extensions: []
-
-extra_rdoc_files:
-- README.rdoc
-files:
-- README.rdoc
-- VERSION.yml
-- lib/smtp-tls.rb
-has_rdoc: true
-homepage: http://github.com/ambethia/smtp-tls
-licenses: []
-
-post_install_message:
-rdoc_options:
-- --inline-source
-- --charset=UTF-8
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-requirements: []
-
-rubyforge_project:
-rubygems_version: 1.3.4
-signing_key:
-specification_version: 2
-summary: SMTP TLS (SSL) extension for Net::SMTP
-test_files: []
-
View
18 vendor/gems/ambethia-smtp-tls-1.1.2/README.rdoc
@@ -1,18 +0,0 @@
-= SMTP-TLS
-
-I didn't author this, so I can't make any claims about it's worth, licensing, or anything else. It's just a gem package for some code that's been floating around for a few years. Check google, or the following for more information:
-
-* http://pastie.caboo.se/135270
-* http://d.hatena.ne.jp/zorio/20060416
-* http://www.prestonlee.com/archives/6
-
-== Dependencies
-
-* Net::SMTP
-* OpenSSL
-
-== Usage
-
- require 'smtp-tls'
-
-Then get back to business as usual.
View
4 vendor/gems/ambethia-smtp-tls-1.1.2/VERSION.yml
@@ -1,4 +0,0 @@
----
-:minor: 1
-:patch: 2
-:major: 1
View
70 vendor/gems/ambethia-smtp-tls-1.1.2/lib/smtp-tls.rb
@@ -1,70 +0,0 @@
-require "openssl"
-require "net/smtp"
-
-Net::SMTP.class_eval do
- private
- def do_start(helodomain, user, secret, authtype)
- raise IOError, 'SMTP session already started' if @started
-
- if RUBY_VERSION > "1.8.6"
- check_auth_args user, secret if user or secret
- else
- check_auth_args user, secret, authtype if user or secret
- end
-
- sock = timeout(@open_timeout) { TCPSocket.open(@address, @port) }
- @socket = Net::InternetMessageIO.new(sock)
- @socket.read_timeout = 60 #@read_timeout
-
- check_response(critical { recv_response() })
- do_helo(helodomain)
-
- if starttls
- raise 'openssl library not installed' unless defined?(OpenSSL)
- ssl = OpenSSL::SSL::SSLSocket.new(sock)
- ssl.sync_close = true
- ssl.connect
- @socket = Net::InternetMessageIO.new(ssl)
- @socket.read_timeout = 60 #@read_timeout
- do_helo(helodomain)
- end
-
- authenticate user, secret, authtype if user
- @started = true
- ensure
- unless @started
- # authentication failed, cancel connection.
- @socket.close if not @started and @socket and not @socket.closed?
- @socket = nil
- end
- end
-
- def do_helo(helodomain)
- begin
- if @esmtp
- ehlo helodomain
- else
- helo helodomain
- end
- rescue Net::ProtocolError
- if @esmtp
- @esmtp = false
- @error_occured = false
- retry
- end
- raise
- end
- end
-
- def starttls
- getok('STARTTLS') rescue return false
- return true
- end
-
- def quit
- begin
- getok('QUIT')
- rescue EOFError
- end
- end
-end
View
175 vendor/gems/aws-s3-0.6.2/.specification
@@ -1,175 +0,0 @@
---- !ruby/object:Gem::Specification
-name: aws-s3
-version: !ruby/object:Gem::Version
- version: 0.6.2
-platform: ruby
-authors:
-- Marcel Molina Jr.
-autorequire:
-bindir: bin
-cert_chain: []
-
-date: 2009-04-28 00:00:00 -04:00
-default_executable: s3sh
-dependencies:
-- !ruby/object:Gem::Dependency
- name: xml-simple
- type: :runtime
- version_requirement:
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-- !ruby/object:Gem::Dependency
- name: builder
- type: :runtime
- version_requirement:
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-- !ruby/object:Gem::Dependency
- name: mime-types
- type: :runtime
- version_requirement:
- version_requirements: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-description: Client library for Amazon's Simple Storage Service's REST API
-email: marcel@vernix.org
-executables:
-- s3sh
-extensions: []
-
-extra_rdoc_files:
-- README
-- COPYING
-- INSTALL
-files:
-- Rakefile
-- lib/aws/s3/acl.rb
-- lib/aws/s3/authentication.rb
-- lib/aws/s3/base.rb
-- lib/aws/s3/bittorrent.rb
-- lib/aws/s3/bucket.rb
-- lib/aws/s3/connection.rb
-- lib/aws/s3/error.rb
-- lib/aws/s3/exceptions.rb
-- lib/aws/s3/extensions.rb
-- lib/aws/s3/logging.rb
-- lib/aws/s3/object.rb
-- lib/aws/s3/owner.rb
-- lib/aws/s3/parsing.rb
-- lib/aws/s3/response.rb
-- lib/aws/s3/service.rb
-- lib/aws/s3/version.rb
-- lib/aws/s3.rb
-- bin/s3sh
-- bin/setup.rb
-- support/faster-xml-simple/lib/faster_xml_simple.rb
-- support/faster-xml-simple/test/regression_test.rb
-- support/faster-xml-simple/test/test_helper.rb
-- support/faster-xml-simple/test/xml_simple_comparison_test.rb
-- support/rdoc/code_info.rb
-- README
-- COPYING
-- INSTALL
-- test/acl_test.rb
-- test/authentication_test.rb
-- test/base_test.rb
-- test/bucket_test.rb
-- test/connection_test.rb
-- test/error_test.rb
-- test/extensions_test.rb
-- test/fixtures/buckets.yml
-- test/fixtures/errors.yml
-- test/fixtures/headers.yml
-- test/fixtures/logging.yml
-- test/fixtures/loglines.yml
-- test/fixtures/logs.yml
-- test/fixtures/policies.yml
-- test/fixtures.rb
-- test/logging_test.rb
-- test/mocks/fake_response.rb
-- test/object_test.rb
-- test/parsing_test.rb
-- test/remote/acl_test.rb
-- test/remote/bittorrent_test.rb
-- test/remote/bucket_test.rb
-- test/remote/logging_test.rb
-- test/remote/object_test.rb
-- test/remote/test_file.data
-- test/remote/test_helper.rb
-- test/response_test.rb
-- test/service_test.rb
-- test/test_helper.rb
-has_rdoc: true
-homepage: http://amazon.rubyforge.org
-licenses: []
-
-post_install_message:
-rdoc_options:
-- --title
-- AWS::S3 -- Support for Amazon S3's REST api
-- --main
-- README
-- --line-numbers
-- --inline-source
-require_paths:
-- lib
-required_ruby_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-required_rubygems_version: !ruby/object:Gem::Requirement
- requirements:
- - - ">="
- - !ruby/object:Gem::Version
- version: "0"
- version:
-requirements: []
-
-rubyforge_project: amazon
-rubygems_version: 1.3.3
-signing_key:
-specification_version: 3
-summary: Client library for Amazon's Simple Storage Service's REST API
-test_files:
-- test/acl_test.rb
-- test/authentication_test.rb
-- test/base_test.rb
-- test/bucket_test.rb
-- test/connection_test.rb
-- test/error_test.rb
-- test/extensions_test.rb
-- test/fixtures/buckets.yml
-- test/fixtures/errors.yml
-- test/fixtures/headers.yml
-- test/fixtures/logging.yml
-- test/fixtures/loglines.yml
-- test/fixtures/logs.yml
-- test/fixtures/policies.yml
-- test/fixtures.rb
-- test/logging_test.rb
-- test/mocks/fake_response.rb
-- test/object_test.rb
-- test/parsing_test.rb
-- test/remote/acl_test.rb
-- test/remote/bittorrent_test.rb
-- test/remote/bucket_test.rb
-- test/remote/logging_test.rb
-- test/remote/object_test.rb
-- test/remote/test_file.data
-- test/remote/test_helper.rb
-- test/response_test.rb
-- test/service_test.rb
-- test/test_helper.rb
View
19 vendor/gems/aws-s3-0.6.2/COPYING
@@ -1,19 +0,0 @@
-#
-# Copyright (c) 2006-2009 Marcel Molina Jr. <marcel@vernix.org>
-#
-# 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
55 vendor/gems/aws-s3-0.6.2/INSTALL
@@ -1,55 +0,0 @@
-== Rubygems
-
-The easiest way to install aws/s3 is with Rubygems:
-
- % sudo gem i aws-s3 -ry
-
-== Directly from svn
-
- % svn co svn://rubyforge.org/var/svn/amazon/s3/trunk aws
-
-== As a Rails plugin
-
-If you want to use aws/s3 with a Rails application, you can export the repository
-into your plugins directory and then check it in:
-
- % cd my-rails-application/vendor/plugins
- % svn export svn://rubyforge.org/var/svn/amazon/s3/trunk aws
- % svn add aws
-
-Or you could pull it down with an svn:externals:
-
- % cd my-rails-application/vendor/plugins
- % svn propedit svn:externals .
-
-Then add the following line, save and exit:
-
- aws svn://rubyforge.org/var/svn/amazon/s3/trunk
-
-If you go the svn route, be sure that you have all the dependencies installed. The list of dependencies follow.
-
-== Dependencies
-
-AWS::S3 requires Ruby 1.8.4 or greater.
-
-It also has the following dependencies:
-
- sudo gem i xml-simple -ry
- sudo gem i builder -ry
- sudo gem i mime-types -ry
-
-=== XML parsing (xml-simple)
-
-AWS::S3 depends on XmlSimple (http://xml-simple.rubyforge.org/). When installing aws/s3 with
-Rubygems, this dependency will be taken care of for you. Otherwise, installation instructions are listed on the xml-simple
-site.
-
-If your system has the Ruby libxml bindings installed (http://libxml.rubyforge.org/) they will be used instead of REXML (which is what XmlSimple uses). For those concerned with speed and efficiency, it would behoove you to install libxml (instructions here: http://libxml.rubyforge.org/install.html) as it is considerably faster and less expensive than REXML.
-
-=== XML generation (builder)
-
-AWS::S3 also depends on the Builder library (http://builder.rubyforge.org/ and http://rubyforge.org/projects/builder/). This will also automatically be installed for you when using Rubygems.
-
-=== Content type inference (mime-types)
-
-AWS::S3 depends on the MIME::Types library (http://mime-types.rubyforge.org/) to infer the content type of an object that does not explicitly specify it. This library will automatically be installed for you when using Rubygems.
View
545 vendor/gems/aws-s3-0.6.2/README
@@ -1,545 +0,0 @@
-= AWS::S3
-
-AWS::S3 is a Ruby library for Amazon's Simple Storage Service's REST API (http://aws.amazon.com/s3).
-Full documentation of the currently supported API can be found at http://docs.amazonwebservices.com/AmazonS3/2006-03-01.
-
-== Getting started
-
-To get started you need to require 'aws/s3':
-
- % irb -rubygems
- irb(main):001:0> require 'aws/s3'
- # => true
-
-The AWS::S3 library ships with an interactive shell called <tt>s3sh</tt>. From within it, you have access to all the operations the library exposes from the command line.
-
- % s3sh
- >> Version
-
-Before you can do anything, you must establish a connection using Base.establish_connection!. A basic connection would look something like this:
-
- AWS::S3::Base.establish_connection!(
- :access_key_id => 'abc',
- :secret_access_key => '123'
- )
-
-The minimum connection options that you must specify are your access key id and your secret access key.
-
-(If you don't already have your access keys, all you need to sign up for the S3 service is an account at Amazon. You can sign up for S3 and get access keys by visiting http://aws.amazon.com/s3.)
-
-For convenience, if you set two special environment variables with the value of your access keys, the console will automatically create a default connection for you. For example:
-
- % cat .amazon_keys
- export AMAZON_ACCESS_KEY_ID='abcdefghijklmnop'
- export AMAZON_SECRET_ACCESS_KEY='1234567891012345'
-
-Then load it in your shell's rc file.
-
- % cat .zshrc
- if [[ -f "$HOME/.amazon_keys" ]]; then
- source "$HOME/.amazon_keys";
- fi
-
-See more connection details at AWS::S3::Connection::Management::ClassMethods.
-
-
-== AWS::S3 Basics
-=== The service, buckets and objects
-
-The three main concepts of S3 are the service, buckets and objects.
-
-==== The service
-
-The service lets you find out general information about your account, like what buckets you have.
-
- Service.buckets
- # => []
-
-
-==== Buckets
-
-Buckets are containers for objects (the files you store on S3). To create a new bucket you just specify its name.
-
- # Pick a unique name, or else you'll get an error
- # if the name is already taken.
- Bucket.create('jukebox')
-
-Bucket names must be unique across the entire S3 system, sort of like domain names across the internet. If you try
-to create a bucket with a name that is already taken, you will get an error.
-
-Assuming the name you chose isn't already taken, your new bucket will now appear in the bucket list:
-
- Service.buckets
- # => [#<AWS::S3::Bucket @attributes={"name"=>"jukebox"}>]
-
-Once you have succesfully created a bucket you can you can fetch it by name using Bucket.find.
-
- music_bucket = Bucket.find('jukebox')
-
-The bucket that is returned will contain a listing of all the objects in the bucket.
-
- music_bucket.objects.size
- # => 0
-
-If all you are interested in is the objects of the bucket, you can get to them directly using Bucket.objects.
-
- Bucket.objects('jukebox').size
- # => 0
-
-By default all objects will be returned, though there are several options you can use to limit what is returned, such as
-specifying that only objects whose name is after a certain place in the alphabet be returned, and etc. Details about these options can
-be found in the documentation for Bucket.find.
-
-To add an object to a bucket you specify the name of the object, its value, and the bucket to put it in.
-
- file = 'black-flowers.mp3'
- S3Object.store(file, open(file), 'jukebox')
-
-You'll see your file has been added to it:
-
- music_bucket.objects
- # => [#<AWS::S3::S3Object '/jukebox/black-flowers.mp3'>]
-
-You can treat your bucket like a hash and access objects by name:
-
- jukebox['black-flowers.mp3']
- # => #<AWS::S3::S3Object '/jukebox/black-flowers.mp3'>
-
-In the event that you want to delete a bucket, you can use Bucket.delete.
-
- Bucket.delete('jukebox')
-
-Keep in mind, like unix directories, you can not delete a bucket unless it is empty. Trying to delete a bucket
-that contains objects will raise a BucketNotEmpty exception.
-
-Passing the :force => true option to delete will take care of deleting all the bucket's objects for you.
-
- Bucket.delete('photos', :force => true)
- # => true
-
-
-==== Objects
-
-S3Objects represent the data you store on S3. They have a key (their name) and a value (their data). All objects belong to a
-bucket.
-
-You can store an object on S3 by specifying a key, its data and the name of the bucket you want to put it in:
-
- S3Object.store('me.jpg', open('headshot.jpg'), 'photos')
-
-The content type of the object will be inferred by its extension. If the appropriate content type can not be inferred, S3 defaults
-to <tt>binary/octet-stream</tt>.
-
-If you want to override this, you can explicitly indicate what content type the object should have with the <tt>:content_type</tt> option:
-
- file = 'black-flowers.m4a'
- S3Object.store(
- file,
- open(file),
- 'jukebox',
- :content_type => 'audio/mp4a-latm'
- )
-
-You can read more about storing files on S3 in the documentation for S3Object.store.
-
-If you just want to fetch an object you've stored on S3, you just specify its name and its bucket:
-
- picture = S3Object.find 'headshot.jpg', 'photos'
-
-N.B. The actual data for the file is not downloaded in both the example where the file appeared in the bucket and when fetched directly.
-You get the data for the file like this:
-
- picture.value
-
-You can fetch just the object's data directly:
-
- S3Object.value 'headshot.jpg', 'photos'
-
-Or stream it by passing a block to <tt>stream</tt>:
-
- open('song.mp3', 'w') do |file|
- S3Object.stream('song.mp3', 'jukebox') do |chunk|
- file.write chunk
- end
- end
-
-The data of the file, once download, is cached, so subsequent calls to <tt>value</tt> won't redownload the file unless you
-tell the object to reload its <tt>value</tt>:
-
- # Redownloads the file's data
- song.value(:reload)
-
-Other functionality includes:
-
- # Check if an object exists?
- S3Object.exists? 'headshot.jpg', 'photos'
-
- # Copying an object
- S3Object.copy 'headshot.jpg', 'headshot2.jpg', 'photos'
-
- # Renaming an object
- S3Object.rename 'headshot.jpg', 'portrait.jpg', 'photos'
-
- # Deleting an object
- S3Object.delete 'headshot.jpg', 'photos'
-
-==== More about objects and their metadata
-
-You can find out the content type of your object with the <tt>content_type</tt> method:
-
- song.content_type
- # => "audio/mpeg"
-
-You can change the content type as well if you like:
-
- song.content_type = 'application/pdf'
- song.store
-
-(Keep in mind that due to limitiations in S3's exposed API, the only way to change things like the content_type
-is to PUT the object onto S3 again. In the case of large files, this will result in fully re-uploading the file.)
-
-A bevie of information about an object can be had using the <tt>about</tt> method:
-
- pp song.about
- {"last-modified" => "Sat, 28 Oct 2006 21:29:26 GMT",
- "content-type" => "binary/octet-stream",
- "etag" => "\"dc629038ffc674bee6f62eb64ff3a\"",
- "date" => "Sat, 28 Oct 2006 21:30:41 GMT",
- "x-amz-request-id" => "B7BC68F55495B1C8",
- "server" => "AmazonS3",
- "content-length" => "3418766"}
-
-You can get and set metadata for an object:
-
- song.metadata
- # => {}
- song.metadata[:album] = "A River Ain't Too Much To Love"
- # => "A River Ain't Too Much To Love"
- song.metadata[:released] = 2005
- pp song.metadata
- {"x-amz-meta-released" => 2005,
- "x-amz-meta-album" => "A River Ain't Too Much To Love"}
- song.store
-
-That metadata will be saved in S3 and is hence forth available from that object:
-
- song = S3Object.find('black-flowers.mp3', 'jukebox')
- pp song.metadata
- {"x-amz-meta-released" => "2005",
- "x-amz-meta-album" => "A River Ain't Too Much To Love"}
- song.metadata[:released]
- # => "2005"
- song.metadata[:released] = 2006
- pp song.metadata
- {"x-amz-meta-released" => 2006,
- "x-amz-meta-album" => "A River Ain't Too Much To Love"}
-
-
-==== Streaming uploads
-
-When storing an object on the S3 servers using S3Object.store, the <tt>data</tt> argument can be a string or an I/O stream.
-If <tt>data</tt> is an I/O stream it will be read in segments and written to the socket incrementally. This approach
-may be desirable for very large files so they are not read into memory all at once.
-
- # Non streamed upload
- S3Object.store('greeting.txt', 'hello world!', 'marcel')
-
- # Streamed upload
- S3Object.store('roots.mpeg', open('roots.mpeg'), 'marcel')
-
-
-== Setting the current bucket
-==== Scoping operations to a specific bucket
-
-If you plan on always using a specific bucket for certain files, you can skip always having to specify the bucket by creating
-a subclass of Bucket or S3Object and telling it what bucket to use:
-
- class JukeBoxSong < AWS::S3::S3Object
- set_current_bucket_to 'jukebox'
- end
-
-For all methods that take a bucket name as an argument, the current bucket will be used if the bucket name argument is omitted.
-
- other_song = 'baby-please-come-home.mp3'
- JukeBoxSong.store(other_song, open(other_song))
-
-This time we didn't have to explicitly pass in the bucket name, as the JukeBoxSong class knows that it will
-always use the 'jukebox' bucket.
-
-"Astute readers", as they say, may have noticed that we used the third parameter to pass in the content type,
-rather than the fourth parameter as we had the last time we created an object. If the bucket can be inferred, or
-is explicitly set, as we've done in the JukeBoxSong class, then the third argument can be used to pass in
-options.
-
-Now all operations that would have required a bucket name no longer do.
-
- other_song = JukeBoxSong.find('baby-please-come-home.mp3')
-
-
-== BitTorrent
-==== Another way to download large files
-
-Objects on S3 can be distributed via the BitTorrent file sharing protocol.
-
-You can get a torrent file for an object by calling <tt>torrent_for</tt>:
-
- S3Object.torrent_for 'kiss.jpg', 'marcel'
-
-Or just call the <tt>torrent</tt> method if you already have the object:
-
- song = S3Object.find 'kiss.jpg', 'marcel'
- song.torrent
-
-Calling <tt>grant_torrent_access_to</tt> on a object will allow anyone to anonymously
-fetch the torrent file for that object:
-
- S3Object.grant_torrent_access_to 'kiss.jpg', 'marcel'
-
-Anonymous requests to
-
- http://s3.amazonaws.com/marcel/kiss.jpg?torrent
-
-will serve up the torrent file for that object.
-
-
-== Access control
-==== Using canned access control policies
-
-By default buckets are private. This means that only the owner has access rights to the bucket and its objects.
-Objects in that bucket inherit the permission of the bucket unless otherwise specified. When an object is private, the owner can
-generate a signed url that exposes the object to anyone who has that url. Alternatively, buckets and objects can be given other
-access levels. Several canned access levels are defined:
-
-* <tt>:private</tt> - Owner gets FULL_CONTROL. No one else has any access rights. This is the default.
-* <tt>:public_read</tt> - Owner gets FULL_CONTROL and the anonymous principal is granted READ access. If this policy is used on an object, it can be read from a browser with no authentication.
-* <tt>:public_read_write</tt> - Owner gets FULL_CONTROL, the anonymous principal is granted READ and WRITE access. This is a useful policy to apply to a bucket, if you intend for any anonymous user to PUT objects into the bucket.
-* <tt>:authenticated_read</tt> - Owner gets FULL_CONTROL, and any principal authenticated as a registered Amazon S3 user is granted READ access.
-
-You can set a canned access level when you create a bucket or an object by using the <tt>:access</tt> option:
-
- S3Object.store(
- 'kiss.jpg',
- data,
- 'marcel',
- :access => :public_read
- )
-
-Since the image we created is publicly readable, we can access it directly from a browser by going to the corresponding bucket name
-and specifying the object's key without a special authenticated url:
-
- http://s3.amazonaws.com/marcel/kiss.jpg
-
-==== Building custum access policies
-
-For both buckets and objects, you can use the <tt>acl</tt> method to see its access control policy:
-
- policy = S3Object.acl('kiss.jpg', 'marcel')
- pp policy.grants
- [#<AWS::S3::ACL::Grant FULL_CONTROL to noradio>,
- #<AWS::S3::ACL::Grant READ to AllUsers Group>]
-
-Policies are made up of one or more grants which grant a specific permission to some grantee. Here we see the default FULL_CONTROL grant
-to the owner of this object. There is also READ permission granted to the Allusers Group, which means anyone has read access for the object.
-
-Say we wanted to grant access to anyone to read the access policy of this object. The current READ permission only grants them permission to read
-the object itself (for example, from a browser) but it does not allow them to read the access policy. For that we will need to grant the AllUsers group the READ_ACP permission.
-
-First we'll create a new grant object:
-
- grant = ACL::Grant.new
- # => #<AWS::S3::ACL::Grant (permission) to (grantee)>
- grant.permission = 'READ_ACP'
-
-Now we need to indicate who this grant is for. In other words, who the grantee is:
-
- grantee = ACL::Grantee.new
- # => #<AWS::S3::ACL::Grantee (xsi not set yet)>
-
-There are three ways to specify a grantee: 1) by their internal amazon id, such as the one returned with an object's Owner,
-2) by their Amazon account email address or 3) by specifying a group. As of this writing you can not create custom groups, but
-Amazon does provide three already: AllUsers, Authenticated and LogDelivery. In this case we want to provide the grant to all users.
-This effectively means "anyone".
-
- grantee.group = 'AllUsers'
-
-Now that our grantee is setup, we'll associate it with the grant:
-
- grant.grantee = grantee
- grant
- # => #<AWS::S3::ACL::Grant READ_ACP to AllUsers Group>
-
-Are grant has all the information we need. Now that it's ready, we'll add it on to the object's access control policy's list of grants:
-
- policy.grants << grant
- pp policy.grants
- [#<AWS::S3::ACL::Grant FULL_CONTROL to noradio>,
- #<AWS::S3::ACL::Grant READ to AllUsers Group>,
- #<AWS::S3::ACL::Grant READ_ACP to AllUsers Group>]
-
-Now that the policy has the new grant, we reuse the <tt>acl</tt> method to persist the policy change:
-
- S3Object.acl('kiss.jpg', 'marcel', policy)
-
-If we fetch the object's policy again, we see that the grant has been added:
-
- pp S3Object.acl('kiss.jpg', 'marcel').grants
- [#<AWS::S3::ACL::Grant FULL_CONTROL to noradio>,
- #<AWS::S3::ACL::Grant READ to AllUsers Group>,
- #<AWS::S3::ACL::Grant READ_ACP to AllUsers Group>]
-
-If we were to access this object's acl url from a browser:
-
- http://s3.amazonaws.com/marcel/kiss.jpg?acl
-
-we would be shown its access control policy.
-
-==== Pre-prepared grants
-
-Alternatively, the ACL::Grant class defines a set of stock grant policies that you can fetch by name. In most cases, you can
-just use one of these pre-prepared grants rather than building grants by hand. Two of these stock policies are <tt>:public_read</tt>
-and <tt>:public_read_acp</tt>, which happen to be the two grants that we built by hand above. In this case we could have simply written:
-
- policy.grants << ACL::Grant.grant(:public_read)
- policy.grants << ACL::Grant.grant(:public_read_acp)
- S3Object.acl('kiss.jpg', 'marcel', policy)
-
-The full details can be found in ACL::Policy, ACL::Grant and ACL::Grantee.
-
-
-==== Accessing private objects from a browser
-
-All private objects are accessible via an authenticated GET request to the S3 servers. You can generate an
-authenticated url for an object like this:
-
- S3Object.url_for('beluga_baby.jpg', 'marcel_molina')
-
-By default authenticated urls expire 5 minutes after they were generated.
-
-Expiration options can be specified either with an absolute time since the epoch with the <tt>:expires</tt> options,
-or with a number of seconds relative to now with the <tt>:expires_in</tt> options:
-
- # Absolute expiration date
- # (Expires January 18th, 2038)
- doomsday = Time.mktime(2038, 1, 18).to_i
- S3Object.url_for('beluga_baby.jpg',
- 'marcel',
- :expires => doomsday)
-
- # Expiration relative to now specified in seconds
- # (Expires in 3 hours)
- S3Object.url_for('beluga_baby.jpg',
- 'marcel',
- :expires_in => 60 * 60 * 3)
-
-You can specify whether the url should go over SSL with the <tt>:use_ssl</tt> option:
-
- # Url will use https protocol
- S3Object.url_for('beluga_baby.jpg',
- 'marcel',
- :use_ssl => true)
-
-By default, the ssl settings for the current connection will be used.
-
-If you have an object handy, you can use its <tt>url</tt> method with the same objects:
-
- song.url(:expires_in => 30)
-
-To get an unauthenticated url for the object, such as in the case
-when the object is publicly readable, pass the
-<tt>:authenticated</tt> option with a value of <tt>false</tt>.
-
- S3Object.url_for('beluga_baby.jpg',
- 'marcel',
- :authenticated => false)
- # => http://s3.amazonaws.com/marcel/beluga_baby.jpg
-
-
-== Logging
-==== Tracking requests made on a bucket
-
-A bucket can be set to log the requests made on it. By default logging is turned off. You can check if a bucket has logging enabled:
-
- Bucket.logging_enabled_for? 'jukebox'
- # => false
-
-Enabling it is easy:
-
- Bucket.enable_logging_for('jukebox')
-
-Unless you specify otherwise, logs will be written to the bucket you want to log. The logs are just like any other object. By default they will start with the prefix 'log-'. You can customize what bucket you want the logs to be delivered to, as well as customize what the log objects' key is prefixed with by setting the <tt>target_bucket</tt> and <tt>target_prefix</tt> option:
-
- Bucket.enable_logging_for(
- 'jukebox', 'target_bucket' => 'jukebox-logs'
- )
-
-Now instead of logging right into the jukebox bucket, the logs will go into the bucket called jukebox-logs.
-
-Once logs have accumulated, you can access them using the <tt>logs</tt> method:
-
- pp Bucket.logs('jukebox')
- [#<AWS::S3::Logging::Log '/jukebox-logs/log-2006-11-14-07-15-24-2061C35880A310A1'>,
- #<AWS::S3::Logging::Log '/jukebox-logs/log-2006-11-14-08-15-27-D8EEF536EC09E6B3'>,
- #<AWS::S3::Logging::Log '/jukebox-logs/log-2006-11-14-08-15-29-355812B2B15BD789'>]
-
-Each log has a <tt>lines</tt> method that gives you information about each request in that log. All the fields are available
-as named methods. More information is available in Logging::Log::Line.
-
- logs = Bucket.logs('jukebox')
- log = logs.first
- line = log.lines.first
- line.operation
- # => 'REST.GET.LOGGING_STATUS'
- line.request_uri
- # => 'GET /jukebox?logging HTTP/1.1'
- line.remote_ip
- # => "67.165.183.125"
-
-Disabling logging is just as simple as enabling it:
-
- Bucket.disable_logging_for('jukebox')
-
-
-== Errors
-==== When things go wrong
-
-Anything you do that makes a request to S3 could result in an error. If it does, the AWS::S3 library will raise an exception
-specific to the error. All exception that are raised as a result of a request returning an error response inherit from the
-ResponseError exception. So should you choose to rescue any such exception, you can simple rescue ResponseError.
-
-Say you go to delete a bucket, but the bucket turns out to not be empty. This results in a BucketNotEmpty error (one of the many
-errors listed at http://docs.amazonwebservices.com/AmazonS3/2006-03-01/ErrorCodeList.html):
-
- begin
- Bucket.delete('jukebox')
- rescue ResponseError => error
- # ...
- end
-
-Once you've captured the exception, you can extract the error message from S3, as well as the full error response, which includes
-things like the HTTP response code:
-
- error
- # => #<AWS::S3::BucketNotEmpty The bucket you tried to delete is not empty>
- error.message
- # => "The bucket you tried to delete is not empty"
- error.response.code
- # => 409
-
-You could use this information to redisplay the error in a way you see fit, or just to log the error and continue on.
-
-
-==== Accessing the last request's response
-
-Sometimes methods that make requests to the S3 servers return some object, like a Bucket or an S3Object.
-Othertimes they return just <tt>true</tt>. Other times they raise an exception that you may want to rescue. Despite all these
-possible outcomes, every method that makes a request stores its response object for you in Service.response. You can always
-get to the last request's response via Service.response.
-
- objects = Bucket.objects('jukebox')
- Service.response.success?
- # => true
-
-This is also useful when an error exception is raised in the console which you weren't expecting. You can
-root around in the response to get more details of what might have gone wrong.
-
-
View
334 vendor/gems/aws-s3-0.6.2/Rakefile
@@ -1,334 +0,0 @@
-require 'rubygems'
-require 'rake'
-require 'rake/testtask'
-require 'rake/rdoctask'
-require 'rake/packagetask'
-require 'rake/gempackagetask'
-
-require File.dirname(__FILE__) + '/lib/aws/s3'
-
-def library_root
- File.dirname(__FILE__)
-end
-
-task :default => :test
-
-Rake::TestTask.new do |test|
- test.pattern = 'test/*_test.rb'
- test.verbose = true
-end
-
-namespace :doc do
- Rake::RDocTask.new do |rdoc|
- rdoc.rdoc_dir = 'doc'
- rdoc.title = "AWS::S3 -- Support for Amazon S3's REST api"
- rdoc.options << '--line-numbers' << '--inline-source'
- rdoc.rdoc_files.include('README')
- rdoc.rdoc_files.include('COPYING')
- rdoc.rdoc_files.include('INSTALL')
- rdoc.rdoc_files.include('lib/**/*.rb')
- end
-
- task :rdoc => 'doc:readme'
-
- task :refresh => :rerdoc do
- system 'open doc/index.html'
- end
-
- task :readme do
- require 'support/rdoc/code_info'
- RDoc::CodeInfo.parse('lib/**/*.rb')
-
- strip_comments = lambda {|comment| comment.gsub(/^# ?/, '')}
- docs_for = lambda do |location|
- info = RDoc::CodeInfo.for(location)
- raise RuntimeError, "Couldn't find documentation for `#{location}'" unless info
- strip_comments[info.comment]
- end
-
- open('README', 'w') do |file|
- file.write ERB.new(IO.read('README.erb')).result(binding)
- end
- end
-
- task :deploy => :rerdoc do
- sh %(scp -r doc marcel@rubyforge.org:/var/www/gforge-projects/amazon/)
- end
-end
-
-namespace :dist do
- spec = Gem::Specification.new do |s|
- s.name = 'aws-s3'
- s.version = Gem::Version.new(AWS::S3::Version)
- s.summary = "Client library for Amazon's Simple Storage Service's REST API"
- s.description = s.summary
- s.email = 'marcel@vernix.org'
- s.author = 'Marcel Molina Jr.'
- s.has_rdoc = true
- s.extra_rdoc_files = %w(README COPYING INSTALL)
- s.homepage = 'http://amazon.rubyforge.org'
- s.rubyforge_project = 'amazon'
- s.files = FileList['Rakefile', 'lib/**/*.rb', 'bin/*', 'support/**/*.rb']
- s.executables << 's3sh'
- s.test_files = Dir['test/**/*']
-
- s.add_dependency 'xml-simple'
- s.add_dependency 'builder'
- s.add_dependency 'mime-types'
- s.rdoc_options = ['--title', "AWS::S3 -- Support for Amazon S3's REST api",
- '--main', 'README',
- '--line-numbers', '--inline-source']
- end
-
- # Regenerate README before packaging
- task :package => 'doc:readme'
- Rake::GemPackageTask.new(spec) do |pkg|
- pkg.need_tar_gz = true
- pkg.package_files.include('{lib,script,test,support}/**/*')
- pkg.package_files.include('README')
- pkg.package_files.include('COPYING')
- pkg.package_files.include('INSTALL')
- pkg.package_files.include('Rakefile')
- end
-
- desc 'Install with gems'
- task :install => :repackage do
- sh "sudo gem i pkg/#{spec.name}-#{spec.version}.gem"
- end
-
- desc 'Uninstall gem'
- task :uninstall do
- sh "sudo gem uninstall #{spec.name} -x"
- end
-
- desc 'Reinstall gem'
- task :reinstall => [:uninstall, :install]
-
- task :confirm_release do
- print "Releasing version #{spec.version}. Are you sure you want to proceed? [Yn] "
- abort if STDIN.getc == ?n
- end
-
- desc 'Tag release'
- task :tag do
- sh %(git tag -a '#{spec.version}-release' -m 'Tagging #{spec.version} release')
- sh 'git push --tags'
- end
-
- desc 'Update changelog to include a release marker'
- task :add_release_marker_to_changelog do
- changelog = IO.read('CHANGELOG')
- changelog.sub!(/^head:/, "#{spec.version}:")
-
- open('CHANGELOG', 'w') do |file|
- file.write "head:\n\n#{changelog}"
- end
- end
-
- task :commit_changelog do
- sh %(git commit CHANGELOG -m "Bump changelog version marker for release")
- sh 'git push'
- end
-
- package_name = lambda {|specification| File.join('pkg', "#{specification.name}-#{specification.version}")}
-
- desc 'Push a release to rubyforge'
- task :release => [:confirm_release, :clean, :add_release_marker_to_changelog, :package, :commit_changelog, :tag] do
- require 'rubyforge'
- package = package_name[spec]
-
- rubyforge = RubyForge.new.configure
- rubyforge.login
-
- user_config = rubyforge.userconfig
- user_config['release_changes'] = YAML.load_file('CHANGELOG')[spec.version.to_s].join("\n")
-
- version_already_released = lambda do
- releases = rubyforge.autoconfig['release_ids']
- releases.has_key?(spec.name) && releases[spec.name][spec.version.to_s]
- end
-
- abort("Release #{spec.version} already exists!") if version_already_released.call
-
- begin
- rubyforge.add_release(spec.rubyforge_project, spec.name, spec.version.to_s, "#{package}.tar.gz", "#{package}.gem")
- puts "Version #{spec.version} released!"
- rescue Exception => exception
- puts 'Release failed!'
- raise
- end
- end
-
- desc 'Upload a beta gem'
- task :push_beta_gem => [:clobber_package, :package] do
- beta_gem = package_name[spec]
- sh %(scp #{beta_gem}.gem marcel@rubyforge.org:/var/www/gforge-projects/amazon/beta)
- end
-
- task :spec do
- puts spec.to_ruby
- end
-end
-
-desc 'Check code to test ratio'
-task :stats do
- library_files = FileList["#{library_root}/lib/**/*.rb"]
- test_files = FileList["#{library_root}/test/**/*_test.rb"]
- count_code_lines = Proc.new do |lines|
- lines.inject(0) do |code_lines, line|
- next code_lines if [/^\s*$/, /^\s*#/].any? {|non_code_line| non_code_line === line}
- code_lines + 1
- end
- end
-
- count_code_lines_for_files = Proc.new do |files|
- files.inject(0) {|code_lines, file| code_lines + count_code_lines[IO.read(file)]}
- end
-
- library_code_lines = count_code_lines_for_files[library_files]
- test_code_lines = count_code_lines_for_files[test_files]
- ratio = Proc.new { sprintf('%.2f', test_code_lines.to_f / library_code_lines)}
-
- puts "Code LOC: #{library_code_lines} Test LOC: #{test_code_lines} Code to Test Ratio: 1:#{ratio.call}"
-end
-
-namespace :test do
- find_file = lambda do |name|
- file_name = lambda {|path| File.join(path, "#{name}.rb")}
- root = $:.detect do |path|
- File.exist?(file_name[path])
- end
- file_name[root] if root
- end
-
- TEST_LOADER = find_file['rake/rake_test_loader']
- multiruby = lambda do |glob|
- system 'multiruby', TEST_LOADER, *Dir.glob(glob)
- end
-
- desc 'Check test coverage'
- task :coverage do
- system("rcov -x Library -x support --sort coverage #{File.join(library_root, 'test/*_test.rb')}")
- show_test_coverage_results
- end
-
- Rake::TestTask.new(:remote) do |test|
- test.pattern = 'test/remote/*_test.rb'
- test.verbose = true
- end
-
- Rake::TestTask.new(:all) do |test|
- test.pattern = 'test/**/*_test.rb'
- test.verbose = true
- end
-
- desc 'Check test coverage of full stack remote tests'
- task :full_coverage do
- system("rcov -x Library -x support --sort coverage #{File.join(library_root, 'test/remote/*_test.rb')} #{File.join(library_root, 'test/*_test.rb')}")
- show_test_coverage_results
- end
-
- desc 'Run local tests against multiple versions of Ruby'
- task :version_audit do
- multiruby['test/*_test.rb']
- end
-
- namespace :version_audit do
- desc 'Run remote tests against multiple versions of Ruby'
- task :remote do
- multiruby['test/remote/*_test.rb']
- end
-
- desc 'Run all tests against multiple versions of Ruby'
- task :all do
- multiruby['test/**/*_test.rb']
- end
- end
-
- def show_test_coverage_results
- system("open #{File.join(library_root, 'coverage/index.html')}") if PLATFORM['darwin']
- end
-
- desc 'Remove coverage products'
- task :clobber_coverage do
- rm_r 'coverage' rescue nil
- end
-end
-
-namespace :todo do
- class << TODOS = IO.read(File.join(library_root, 'TODO'))
- def items
- split("\n").grep(/^\[\s|X\]/)
- end
-
- def completed
- find_items_matching(/^\[X\]/)
- end
-
- def uncompleted
- find_items_matching(/^\[\s\]/)
- end
-
- def find_items_matching(regexp)
- items.grep(regexp).instance_eval do
- def display
- puts map {|item| "* #{item.sub(/^\[[^\]]\]\s/, '')}"}
- end
- self
- end
- end
- end
-
- desc 'Completed todo items'
- task :completed do
- TODOS.completed.display
- end
-
- desc 'Incomplete todo items'
- task :uncompleted do
- TODOS.uncompleted.display
- end
-end if File.exists?(File.join(library_root, 'TODO'))
-
-namespace :site do
- require 'erb'
- require 'rdoc/markup/simple_markup'
- require 'rdoc/markup/simple_markup/to_html'
-
- readme = lambda { IO.read('README')[/^== Getting started\n(.*)/m, 1] }
-
- readme_to_html = lambda do
- handler = SM::ToHtml.new
- handler.instance_eval do
- require 'syntax'
- require 'syntax/convertors/html'
- def accept_verbatim(am, fragment)
- syntax = Syntax::Convertors::HTML.for_syntax('ruby')
- @res << %(<div class="ruby">#{syntax.convert(fragment.txt, true)}</div>)
- end
- end
- SM::SimpleMarkup.new.convert(readme.call, handler)
- end
-
- desc 'Regenerate the public website page'
- task :build => 'doc:readme' do
- open('site/public/index.html', 'w') do |file|
- erb_data = {}
- erb_data[:readme] = readme_to_html.call
- file.write ERB.new(IO.read('site/index.erb')).result(binding)
- end
- end
-
- task :refresh => :build do
- system 'open site/public/index.html'
- end
-
- desc 'Update the live website'
- task :deploy => :build do
- site_files = FileList['site/public/*']
- site_files.delete_if {|file| File.directory?(file)}
- sh %(scp #{site_files.join ' '} marcel@rubyforge.org:/var/www/gforge-projects/amazon/)
- end
-end
-
-task :clean => ['dist:clobber_package', 'doc:clobber_rdoc', 'test:clobber_coverage']
View
6 vendor/gems/aws-s3-0.6.2/bin/s3sh
@@ -1,6 +0,0 @@
-#!/usr/bin/env ruby
-s3_lib = File.dirname(__FILE__) + '/../lib/aws/s3'
-setup = File.dirname(__FILE__) + '/setup'
-irb_name = RUBY_PLATFORM =~ /mswin32/ ? 'irb.bat' : 'irb'
-
-exec "#{irb_name} -r #{s3_lib} -r #{setup} --simple-prompt"
View
10 vendor/gems/aws-s3-0.6.2/bin/setup.rb
@@ -1,10 +0,0 @@
-#!/usr/bin/env ruby
-if ENV['AMAZON_ACCESS_KEY_ID'] && ENV['AMAZON_SECRET_ACCESS_KEY']
- AWS::S3::Base.establish_connection!(
- :access_key_id => ENV['AMAZON_ACCESS_KEY_ID'],
- :secret_access_key => ENV['AMAZON_SECRET_ACCESS_KEY']
- )
-end
-
-require File.dirname(__FILE__) + '/../test/fixtures'
-include AWS::S3
View
60 vendor/gems/aws-s3-0.6.2/lib/aws/s3.rb
@@ -1,60 +0,0 @@
-require 'cgi'
-require 'uri'
-require 'openssl'
-require 'digest/sha1'
-require 'net/https'
-require 'time'
-require 'date'
-require 'open-uri'
-
-$:.unshift(File.dirname(__FILE__))
-require 's3/extensions'
-require_library_or_gem 'builder' unless defined? Builder
-require_library_or_gem 'mime/types', 'mime-types' unless defined? MIME::Types
-
-require 's3/base'
-require 's3/version'
-require 's3/parsing'
-require 's3/acl'
-require 's3/logging'
-require 's3/bittorrent'
-require 's3/service'
-require 's3/owner'
-require 's3/bucket'
-require 's3/object'
-require 's3/error'
-require 's3/exceptions'
-require 's3/connection'
-require 's3/authentication'
-require 's3/response'
-
-AWS::S3::Base.class_eval do
- include AWS::S3::Connection::Management
-end
-
-AWS::S3::Bucket.class_eval do
- include AWS::S3::Logging::Management
- include AWS::S3::ACL::Bucket
-end
-
-AWS::S3::S3Object.class_eval do
- include AWS::S3::ACL::S3Object
- include AWS::S3::BitTorrent
-end
-
-require_library_or_gem 'xmlsimple', 'xml-simple' unless defined? XmlSimple
-# If libxml is installed, we use the FasterXmlSimple library, that provides most of the functionality of XmlSimple
-# except it uses the xml/libxml library for xml parsing (rather than REXML). If libxml isn't installed, we just fall back on
-# XmlSimple.
-AWS::S3::Parsing.parser =
- begin
- require_library_or_gem 'xml/libxml'
- # Older version of libxml aren't stable (bus error when requesting attributes that don't exist) so we
- # have to use a version greater than '0.3.8.2'.
- raise LoadError unless XML::Parser::VERSION > '0.3.8.2'
- $:.push(File.join(File.dirname(__FILE__), '..', '..', 'support', 'faster-xml-simple', 'lib'))
- require_library_or_gem 'faster_xml_simple'
- FasterXmlSimple
- rescue LoadError
- XmlSimple
- end
View
636 vendor/gems/aws-s3-0.6.2/lib/aws/s3/acl.rb
@@ -1,636 +0,0 @@
-module AWS
- module S3
- # By default buckets are private. This means that only the owner has access rights to the bucket and its objects.
- # Objects in that bucket inherit the permission of the bucket unless otherwise specified. When an object is private, the owner can
- # generate a signed url that exposes the object to anyone who has that url. Alternatively, buckets and objects can be given other
- # access levels. Several canned access levels are defined:
- #
- # * <tt>:private</tt> - Owner gets FULL_CONTROL. No one else has any access rights. This is the default.
- # * <tt>:public_read</tt> - Owner gets FULL_CONTROL and the anonymous principal is granted READ access. If this policy is used on an object, it can be read from a browser with no authentication.
- # * <tt>:public_read_write</tt> - Owner gets FULL_CONTROL, the anonymous principal is granted READ and WRITE access. This is a useful policy to apply to a bucket, if you intend for any anonymous user to PUT objects into the bucket.
- # * <tt>:authenticated_read</tt> - Owner gets FULL_CONTROL, and any principal authenticated as a registered Amazon S3 user is granted READ access.
- #
- # You can set a canned access level when you create a bucket or an object by using the <tt>:access</tt> option:
- #
- # S3Object.store(
- # 'kiss.jpg',
- # data,
- # 'marcel',
- # :access => :public_read
- # )
- #
- # Since the image we created is publicly readable, we can access it directly from a browser by going to the corresponding bucket name
- # and specifying the object's key without a special authenticated url:
- #
- # http://s3.amazonaws.com/marcel/kiss.jpg
- #
- # ==== Building custum access policies
- #
- # For both buckets and objects, you can use the <tt>acl</tt> method to see its access control policy:
- #
- # policy = S3Object.acl('kiss.jpg', 'marcel')
- # pp policy.grants
- # [#<AWS::S3::ACL::Grant FULL_CONTROL to noradio>,
- # #<AWS::S3::ACL::Grant READ to AllUsers Group>]
- #
- # Policies are made up of one or more grants which grant a specific permission to some grantee. Here we see the default FULL_CONTROL grant
- # to the owner of this object. There is also READ permission granted to the Allusers Group, which means anyone has read access for the object.
- #
- # Say we wanted to grant access to anyone to read the access policy of this object. The current READ permission only grants them permission to read
- # the object itself (for example, from a browser) but it does not allow them to read the access policy. For that we will need to grant the AllUsers group the READ_ACP permission.
- #
- # First we'll create a new grant object:
- #
- # grant = ACL::Grant.new
- # # => #<AWS::S3::ACL::Grant (permission) to (grantee)>
- # grant.permission = 'READ_ACP'
- #
- # Now we need to indicate who this grant is for. In other words, who the grantee is:
- #
- # grantee = ACL::Grantee.new
- # # => #<AWS::S3::ACL::Grantee (xsi not set yet)>
- #
- # There are three ways to specify a grantee: 1) by their internal amazon id, such as the one returned with an object's Owner,
- # 2) by their Amazon account email address or 3) by specifying a group. As of this writing you can not create custom groups, but
- # Amazon does provide three already: AllUsers, Authenticated and LogDelivery. In this case we want to provide the grant to all users.
- # This effectively means "anyone".
- #
- # grantee.group = 'AllUsers'
- #
- # Now that our grantee is setup, we'll associate it with the grant:
- #
- # grant.grantee = grantee
- # grant
- # # => #<AWS::S3::ACL::Grant READ_ACP to AllUsers Group>
- #
- # Are grant has all the information we need. Now that it's ready, we'll add it on to the object's access control policy's list of grants:
- #
- # policy.grants << grant
- # pp policy.grants
- # [#<AWS::S3::ACL::Grant FULL_CONTROL to noradio>,
- # #<AWS::S3::ACL::Grant READ to AllUsers Group>,
- # #<AWS::S3::ACL::Grant READ_ACP to AllUsers Group>]
- #
- # Now that the policy has the new grant, we reuse the <tt>acl</tt> method to persist the policy change:
- #
- # S3Object.acl('kiss.jpg', 'marcel', policy)
- #
- # If we fetch the object's policy again, we see that the grant has been added:
- #
- # pp S3Object.acl('kiss.jpg', 'marcel').grants
- # [#<AWS::S3::ACL::Grant FULL_CONTROL to noradio>,
- # #<AWS::S3::ACL::Grant READ to AllUsers Group>,
- # #<AWS::S3::ACL::Grant READ_ACP to AllUsers Group>]
- #
- # If we were to access this object's acl url from a browser:
- #
- # http://s3.amazonaws.com/marcel/kiss.jpg?acl
- #
- # we would be shown its access control policy.
- #
- # ==== Pre-prepared grants
- #
- # Alternatively, the ACL::Grant class defines a set of stock grant policies that you can fetch by name. In most cases, you can
- # just use one of these pre-prepared grants rather than building grants by hand. Two of these stock policies are <tt>:public_read</tt>
- # and <tt>:public_read_acp</tt>, which happen to be the two grants that we built by hand above. In this case we could have simply written:
- #
- # policy.grants << ACL::Grant.grant(:public_read)
- # policy.grants << ACL::Grant.grant(:public_read_acp)
- # S3Object.acl('kiss.jpg', 'marcel', policy)
- #
- # The full details can be found in ACL::Policy, ACL::Grant and ACL::Grantee.
- module ACL
- # The ACL::Policy class lets you inspect and modify access controls for buckets and objects.
- # A policy is made up of one or more Grants which specify a permission and a Grantee to whom that permission is granted.
- #
- # Buckets and objects are given a default access policy which contains one grant permitting the owner of the bucket or object
- # FULL_CONTROL over its contents. This means they can read the object, write to the object, as well as read and write its
- # policy.
- #
- # The <tt>acl</tt> method for both buckets and objects returns the policy object for that entity:
- #
- # policy = Bucket.acl('some-bucket')
- #
- # The <tt>grants</tt> method of a policy exposes its grants. You can treat this collection as an array and push new grants onto it:
- #
- # policy.grants << grant
- #
- # Check the documentation for Grant and Grantee for more details on how to create new grants.
- class Policy
- include SelectiveAttributeProxy #:nodoc:
- attr_accessor :owner, :grants
-
- def initialize(attributes = {})
- @attributes = attributes
- @grants = [].extend(GrantListExtensions)
- extract_owner! if owner?
- extract_grants! if grants?
- end
-
- # The xml representation of the policy.
- def to_xml
- Builder.new(owner, grants).to_s
- end
-
- private
-
- def owner?
- attributes.has_key?('owner') || !owner.nil?
- end
-
- def grants?
- (attributes.has_key?('access_control_list') && attributes['access_control_list']['grant']) || !grants.empty?
- end
-
- def extract_owner!
- @owner = Owner.new(attributes.delete('owner'))
- end
-
- def extract_grants!
- attributes['access_control_list']['grant'].each do |grant|
- grants << Grant.new(grant)
- end
- end
-
- module GrantListExtensions #:nodoc:
- def include?(grant)
- case grant
- when Symbol
- super(ACL::Grant.grant(grant))
- else
- super
- end
- end
-
- def delete(grant)
- case grant
- when Symbol
- super(ACL::Grant.grant(grant))
- else
- super
- end
- end
-
- # Two grant lists are equal if they have identical grants both in terms of permission and grantee.
- def ==(grants)
- size == grants.size && all? {|grant| grants.include?(grant)}
- end
- end
-
- class Builder < XmlGenerator #:nodoc:
- attr_reader :owner, :grants
- def initialize(owner, grants)
- @owner = owner
- @grants = grants.uniq # There could be some duplicate grants
- super()
- end
-
- def build
- xml.tag!('AccessControlPolicy', 'xmlns' => 'http://s3.amazonaws.com/doc/2006-03-01/') do
- xml.Owner do
- xml.ID owner.id
- xml.DisplayName owner.display_name
- end
-
- xml.AccessControlList do
- xml << grants.map {|grant| grant.to_xml}.join("\n")
- end
- end
- end
- end
- end
-
- # A Policy is made up of one or more Grant objects. A grant sets a specific permission and grants it to the associated grantee.
- #
- # When creating a new grant to add to a policy, you need only set its permission and then associate with a Grantee.
- #
- # grant = ACL::Grant.new
- # => #<AWS::S3::ACL::Grant (permission) to (grantee)>
- #
- # Here we see that neither the permission nor the grantee have been set. Let's make this grant provide the READ permission.
- #
- # grant.permission = 'READ'
- # grant
- # => #<AWS::S3::ACL::Grant READ to (grantee)>
- #
- # Now let's assume we have a grantee to the AllUsers group already set up. Just associate that grantee with our grant.
- #
- # grant.grantee = all_users_group_grantee
- # grant
- # => #<AWS::S3::ACL::Grant READ to AllUsers Group>
- #
- # And now are grant is complete. It provides READ permission to the AllUsers group, effectively making this object publicly readable
- # without any authorization.
- #
- # Assuming we have some object's policy available in a local variable called <tt>policy</tt>, we can now add this grant onto its
- # collection of grants.
- #
- # policy.grants << grant
- #
- # And then we send the updated policy to the S3 servers.
- #
- # some_s3object.acl(policy)
- class Grant
- include SelectiveAttributeProxy #:nodoc:
- constant :VALID_PERMISSIONS, %w(READ WRITE READ_ACP WRITE_ACP FULL_CONTROL)
- attr_accessor :grantee
-
- class << self
- # Returns stock grants with name <tt>type</tt>.
- #
- # public_read_grant = ACL::Grant.grant :public_read
- # => #<AWS::S3::ACL::Grant READ to AllUsers Group>
- #
- # Valid stock grant types are:
- #
- # * <tt>:authenticated_read</tt>
- # * <tt>:authenticated_read_acp</tt>
- # * <tt>:authenticated_write</tt>
- # * <tt>:authenticated_write_acp</tt>
- # * <tt>:logging_read</tt>
- # * <tt>:logging_read_acp</tt>
- # * <tt>:logging_write</tt>
- # * <tt>:logging_write_acp</tt>
- # * <tt>:public_read</tt>
- # * <tt>:public_read_acp</tt>
- # * <tt>:public_write</tt>
- # * <tt>:public_write_acp</tt>
- def grant(type)
- case type
- when *stock_grant_map.keys
- build_stock_grant_for type
- else
- raise ArgumentError, "Unknown grant type `#{type}'"
- end
- end
-
- private
- def stock_grant_map
- grant = lambda {|permission, group| {:permission => permission, :group => group}}
- groups = {:public => 'AllUsers', :authenticated => 'Authenticated', :logging => 'LogDelivery'}
- permissions = %w(READ WRITE READ_ACP WRITE_ACP)
- stock_grants = {}
- groups.each do |grant_group_name, group_name|
- permissions.each do |permission|
- stock_grants["#{grant_group_name}_#{permission.downcase}".to_sym] = grant[permission, group_name]
- end
- end
- stock_grants
- end
- memoized :stock_grant_map
-
- def build_stock_grant_for(type)
- stock_grant = stock_grant_map[type]
- grant = new do |g|
- g.permission = stock_grant[:permission]
- end
- grant.grantee = Grantee.new do |gr|
- gr.group = stock_grant[:group]
- end
- grant
- end
- end
-
- def initialize(attributes = {})
- attributes = {'permission' => nil}.merge(attributes)
- @attributes = attributes
- extract_grantee!
- yield self if block_given?
- end
-
- # Set the permission for this grant.
- #
- # grant.permission = 'READ'
- # grant
- # => #<AWS::S3::ACL::Grant READ to (grantee)>
- #
- # If the specified permisison level is not valid, an <tt>InvalidAccessControlLevel</tt> exception will be raised.
- def permission=(permission_level)
- unless self.class.valid_permissions.include?(permission_level)
- raise InvalidAccessControlLevel.new(self.class.valid_permissions, permission_level)
- end
- attributes['permission'] = permission_level
- end
-
- # The xml representation of this grant.
- def to_xml
- Builder.new(permission, grantee).to_s
- end
-
- def inspect #:nodoc:
- "#<%s:0x%s %s>" % [self.class, object_id, self]
- end
-
- def to_s #:nodoc:
- [permission || '(permission)', 'to', grantee ? grantee.type_representation : '(grantee)'].join ' '
- end
-
- def eql?(grant) #:nodoc:
- # This won't work for an unposted AmazonCustomerByEmail because of the normalization
- # to CanonicalUser but it will work for groups.
- to_s == grant.to_s
- end
- alias_method :==, :eql?
-
- def hash #:nodoc:
- to_s.hash
- end
-
- private
-
- def extract_grantee!
- @grantee = Grantee.new(attributes['grantee']) if attributes['grantee']