kuva 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.env.example +4 -0
  4. data/.gitignore +13 -0
  5. data/.rspec +1 -0
  6. data/.ruby-gemset +1 -0
  7. data/.ruby-version +1 -0
  8. data/.travis.yml +12 -0
  9. data/Gemfile +26 -0
  10. data/Gemfile.lock +187 -0
  11. data/MIT-LICENSE +20 -0
  12. data/README.md +129 -0
  13. data/Rakefile +14 -0
  14. data/app/assets/images/kuva/.keep +0 -0
  15. data/app/assets/javascripts/kuva/application.js +13 -0
  16. data/app/assets/javascripts/kuva/jquery-2.1.0.min.js +4 -0
  17. data/app/assets/javascripts/kuva/jquery.justified_gallery.min.js +7 -0
  18. data/app/assets/javascripts/kuva/kuva.js.coffee +2 -0
  19. data/app/assets/stylesheets/kuva/application.css +13 -0
  20. data/app/assets/stylesheets/kuva/justified_gallery.min.css +7 -0
  21. data/app/assets/stylesheets/kuva/kuva.css.sass +42 -0
  22. data/app/controllers/kuva/application_controller.rb +17 -0
  23. data/app/controllers/kuva/photos_controller.rb +10 -0
  24. data/app/controllers/kuva/sets_controller.rb +24 -0
  25. data/app/helpers/kuva/application_helper.rb +31 -0
  26. data/app/views/kuva/photos/show.html.haml +6 -0
  27. data/app/views/kuva/sets/index.html.haml +8 -0
  28. data/app/views/kuva/sets/show.html.haml +8 -0
  29. data/app/views/layouts/kuva/application.html.haml +10 -0
  30. data/config/locales/cli.yml +8 -0
  31. data/config/locales/frontend.yml +4 -0
  32. data/config/routes.rb +9 -0
  33. data/kuva.gemspec +25 -0
  34. data/lib/generators/kuva/install_generator.rb +20 -0
  35. data/lib/generators/kuva/templates/kuva.rb +34 -0
  36. data/lib/generators/kuva/views_generator.rb +23 -0
  37. data/lib/kuva.rb +23 -0
  38. data/lib/kuva/authorizer.rb +50 -0
  39. data/lib/kuva/elements/photo.rb +41 -0
  40. data/lib/kuva/elements/photoset.rb +49 -0
  41. data/lib/kuva/elements/photoset_collection.rb +25 -0
  42. data/lib/kuva/elements/url_info.rb +6 -0
  43. data/lib/kuva/engine.rb +9 -0
  44. data/lib/kuva/version.rb +3 -0
  45. data/lib/tasks/kuva_task.rake +6 -0
  46. data/spec/controllers/kuva/application_controller_spec.rb +42 -0
  47. data/spec/controllers/kuva/photos_controller_spec.rb +22 -0
  48. data/spec/controllers/kuva/sets_controller_spec.rb +51 -0
  49. data/spec/dummy/README.md +1 -0
  50. data/spec/dummy/Rakefile +6 -0
  51. data/spec/dummy/app/assets/images/.keep +0 -0
  52. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  53. data/spec/dummy/app/assets/stylesheets/application.css +13 -0
  54. data/spec/dummy/app/controllers/application_controller.rb +5 -0
  55. data/spec/dummy/app/controllers/concerns/.keep +0 -0
  56. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  57. data/spec/dummy/app/mailers/.keep +0 -0
  58. data/spec/dummy/app/models/.keep +0 -0
  59. data/spec/dummy/app/models/concerns/.keep +0 -0
  60. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  61. data/spec/dummy/bin/bundle +3 -0
  62. data/spec/dummy/bin/rails +4 -0
  63. data/spec/dummy/bin/rake +4 -0
  64. data/spec/dummy/config.ru +4 -0
  65. data/spec/dummy/config/application.rb +30 -0
  66. data/spec/dummy/config/boot.rb +5 -0
  67. data/spec/dummy/config/database.yml +25 -0
  68. data/spec/dummy/config/environment.rb +5 -0
  69. data/spec/dummy/config/environments/development.rb +29 -0
  70. data/spec/dummy/config/environments/production.rb +80 -0
  71. data/spec/dummy/config/environments/test.rb +39 -0
  72. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  73. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  74. data/spec/dummy/config/initializers/inflections.rb +16 -0
  75. data/spec/dummy/config/initializers/kuva.rb +29 -0
  76. data/spec/dummy/config/initializers/mime_types.rb +5 -0
  77. data/spec/dummy/config/initializers/secret_token.rb +12 -0
  78. data/spec/dummy/config/initializers/session_store.rb +3 -0
  79. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  80. data/spec/dummy/config/locales/en.yml +23 -0
  81. data/spec/dummy/config/routes.rb +4 -0
  82. data/spec/dummy/lib/assets/.keep +0 -0
  83. data/spec/dummy/log/.keep +0 -0
  84. data/spec/dummy/public/404.html +58 -0
  85. data/spec/dummy/public/422.html +58 -0
  86. data/spec/dummy/public/500.html +57 -0
  87. data/spec/dummy/public/favicon.ico +0 -0
  88. data/spec/features/photo_spec.rb +40 -0
  89. data/spec/features/photoset_collection_spec.rb +25 -0
  90. data/spec/features/photoset_spec.rb +42 -0
  91. data/spec/generators/kuva/install_generator_spec.rb +30 -0
  92. data/spec/generators/kuva/views_generator_spec.rb +37 -0
  93. data/spec/helpers/kuva/application_helper_spec.rb +26 -0
  94. data/spec/kuva/authorizer_spec.rb +83 -0
  95. data/spec/kuva/elements/photo_spec.rb +76 -0
  96. data/spec/kuva/elements/photoset_collection_spec.rb +42 -0
  97. data/spec/kuva/elements/photoset_spec.rb +106 -0
  98. data/spec/kuva/elements/url_info_spec.rb +25 -0
  99. data/spec/kuva_spec.rb +81 -0
  100. data/spec/spec_helper.rb +68 -0
  101. data/spec/support/vcr/cassettes/Kuva_ApplicationController/configuring_Kuva/sets_the_API_key.yml +160 -0
  102. data/spec/support/vcr/cassettes/Kuva_ApplicationController/configuring_Kuva/sets_the_access_secret.yml +160 -0
  103. data/spec/support/vcr/cassettes/Kuva_ApplicationController/configuring_Kuva/sets_the_access_token.yml +160 -0
  104. data/spec/support/vcr/cassettes/Kuva_ApplicationHelper/_breadcrumbs_for/when_the_current_page_is_NOT_the_set_page/creates_a_breadcrumb_with_the_set_URL.yml +65 -0
  105. data/spec/support/vcr/cassettes/Kuva_ApplicationHelper/_breadcrumbs_for/when_the_current_page_is_the_set_page/creates_a_breadcrumb_without_the_set_URL.yml +222 -0
  106. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_find/fetches_the_photo_from_Flickr_specified_by_id.yml +95 -0
  107. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_find/instantiates_a_new_Kuva_Elements_Photo_object.yml +252 -0
  108. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/does_NOT_set_the_is_primary_boolean.yml +252 -0
  109. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/returns_itself.yml +95 -0
  110. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/saves_a_reference_to_the_description.yml +95 -0
  111. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/saves_a_reference_to_the_farm.yml +95 -0
  112. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/saves_a_reference_to_the_id.yml +95 -0
  113. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/saves_a_reference_to_the_secret.yml +95 -0
  114. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/saves_a_reference_to_the_server.yml +252 -0
  115. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/_initialize/saves_a_reference_to_the_title.yml +95 -0
  116. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/image_URLs/generates_an_image_URL_for_a_default_sized_medium_image.yml +95 -0
  117. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/image_URLs/generates_an_image_URL_for_a_n-sized_small_320_image.yml +252 -0
  118. data/spec/support/vcr/cassettes/Kuva_Elements_Photo/image_URLs/instantiates_a_new_URL_info_object_to_create_image_URLs.yml +95 -0
  119. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_find/fetches_the_photoset_from_Flickr_specified_by_id.yml +65 -0
  120. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_find/instantiates_a_new_Kuva_Elements_Photoset_object.yml +65 -0
  121. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_image_url/generates_an_image_URL_for_a_large_square_image.yml +65 -0
  122. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_image_url/instantiates_a_new_URL_info_object_to_create_an_image_URL.yml +222 -0
  123. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/returns_itself.yml +65 -0
  124. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_created_at_date.yml +65 -0
  125. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_description.yml +65 -0
  126. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_farm.yml +65 -0
  127. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_id.yml +65 -0
  128. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_number_of_photos.yml +65 -0
  129. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_number_of_views.yml +65 -0
  130. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_primary_id.yml +222 -0
  131. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_secret.yml +65 -0
  132. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_server.yml +65 -0
  133. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_title.yml +222 -0
  134. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_initialize/saves_a_reference_to_the_updated_at_date.yml +65 -0
  135. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_with_photos/returns_an_array.yml +162 -0
  136. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_with_photos/returns_an_array_with_the_size_specified_by_number_of_photos.yml +162 -0
  137. data/spec/support/vcr/cassettes/Kuva_Elements_Photoset/_with_photos/wraps_the_photos_into_a_Kuva_Elements_Photo_element.yml +319 -0
  138. data/spec/support/vcr/cassettes/Kuva_Elements_PhotosetCollection/_photosets/retrieves_all_photosets.yml +2761 -0
  139. data/spec/support/vcr/cassettes/Kuva_Elements_PhotosetCollection/_photosets/returns_an_array.yml +2918 -0
  140. data/spec/support/vcr/cassettes/Kuva_Elements_PhotosetCollection/_photosets/wraps_the_photosets_into_a_Kuva_Elements_Photoset_element.yml +2761 -0
  141. data/spec/support/vcr/cassettes/Kuva_Elements_PhotosetCollection/_retrieve/fetches_all_photosets_from_Flickr.yml +2918 -0
  142. data/spec/support/vcr/cassettes/Kuva_Elements_PhotosetCollection/_retrieve/instantiates_a_new_Kuva_Elements_PhotosetCollection_object.yml +2761 -0
  143. data/spec/support/vcr/cassettes/Kuva_PhotosController/_show/assigns_the_photo.yml +314 -0
  144. data/spec/support/vcr/cassettes/Kuva_PhotosController/_show/finds_the_photo.yml +157 -0
  145. data/spec/support/vcr/cassettes/Kuva_SetsController/_index/assigns_the_photoset_collection_with_photosets.yml +2761 -0
  146. data/spec/support/vcr/cassettes/Kuva_SetsController/_index/knows_its_type.yml +2918 -0
  147. data/spec/support/vcr/cassettes/Kuva_SetsController/_index/retrieves_the_entire_photoset_collection.yml +160 -0
  148. data/spec/support/vcr/cassettes/Kuva_SetsController/_show/assigns_the_photos_of_the_specified_photoset.yml +2858 -0
  149. data/spec/support/vcr/cassettes/Kuva_SetsController/_show/finds_the_specified_photoset_within_the_entire_photoset_collection.yml +2858 -0
  150. data/spec/support/vcr/cassettes/Kuva_SetsController/_show/knows_its_type.yml +2858 -0
  151. data/spec/support/vcr/cassettes/photo/navigating_back_to_the_photoset_page.yml +3169 -0
  152. data/spec/support/vcr/cassettes/photo/viewing_the_first_photo_of_the_photoset.yml +157 -0
  153. data/spec/support/vcr/cassettes/photoset/navigating_back_to_the_photoset_collection_page.yml +5616 -0
  154. data/spec/support/vcr/cassettes/photoset/navigating_to_the_page_with_details_of_the_first_photo.yml +3012 -0
  155. data/spec/support/vcr/cassettes/photoset/viewing_the_first_photo_of_the_photoset.yml +314 -0
  156. data/spec/support/vcr/cassettes/photoset/viewing_the_first_photoset_of_the_photoset_collection.yml +3015 -0
  157. data/spec/support/vcr/cassettes/photoset_collection/navigating_to_the_page_with_photos_of_the_first_photoset.yml +5616 -0
  158. data/spec/support/vcr/cassettes/photoset_collection/viewing_the_photoset_collection.yml +2761 -0
  159. data/spec/support/vcr/vcr.rb +17 -0
  160. metadata +398 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: a7560a03d6b2c0c357e7eb7b4818988e1644380c
4
+ data.tar.gz: 5f4773c026dbf788be51acf460496b2bc9573d2f
5
+ SHA512:
6
+ metadata.gz: c2fb4f53b5aed2f2034ecf7d9fc211805a7de4da2dee3d73c724e6a700e7566f214149ec6e36339750da9a0a351bb87aefb39ec923ebbc2b40883ab591d548f4
7
+ data.tar.gz: 732202b071e1e4a38b8199a0870359ded6bc1ac0f0bcc4b630395cc84c41ae589384ede3fcb1006077d3c9c063e9f4dcbc2a7274000e8ed39925af543727b258
@@ -0,0 +1 @@
1
+ service_name: travis-ci
@@ -0,0 +1,4 @@
1
+ KUVA_API_KEY: "xxx"
2
+ KUVA_SHARED_SECRET: "xxx"
3
+ KUVA_ACCESS_TOKEN: "xxx"
4
+ KUVA_ACCESS_SECRET: "xxx"
@@ -0,0 +1,13 @@
1
+ .DS_Store
2
+ .sass-cache
3
+
4
+ .env
5
+ .bundle/
6
+ log/*.log
7
+ pkg/
8
+ spec/dummy/db/*.sqlite3
9
+ spec/dummy/db/*.sqlite3-journal
10
+ spec/dummy/log/*.log
11
+ spec/dummy/tmp/
12
+ spec/dummy/.sass-cache
13
+ coverage/
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --color
@@ -0,0 +1 @@
1
+ kuva
@@ -0,0 +1 @@
1
+ ruby-2.0.0-p353
@@ -0,0 +1,12 @@
1
+ language: ruby
2
+ script: bundle exec rake
3
+ rvm:
4
+ - 2.1.0
5
+ - 2.0.0
6
+ - 1.9.3
7
+ env:
8
+ global:
9
+ - secure: bnOruf8nDL/RW73YuNdwFsk0Mp0lKc+cu2tYQj95oYluDVaE2HbHXGUsQ0h3xJXBPwZhQTm5eSqdIlAi9WBau8XZ+yAzMFOtF2MhiZYChS7ZoSHBFZMwaL0aWFKC6R50niNHWXhvvg+63hDvMuG+5VWQobeIjac7WWriiSuAvSE=
10
+ - secure: Rqtp1maxRYXjKZ3yltm4hFsnb21NY8kB76h9CqkShCTrgxQCcEEwvyIMCbO7TZXUKskuV1h9U++3LOs/66a5FtTHDihnhlRbgRVodUcC5y7oIe9A8WJhTVg1R0+vOj5itn7CMu64Ne70dF+OSR1lPi6FcEKK2ktN3YAoQ7wM830=
11
+ - secure: Xlw44/uFPjcHVj9MULZjMeHzoJWZm5GL3Yd5L6D6jvAGbxh2PtWe4IjQsWcBXzaRAUZ3egieZOFiJMm7f8BCyfXfRhwImONrYpHWkS1AdO1d/9eK+/OaHIYVrFcKZQSuP0PIacEW6+nSoLjug8TbcdfE7BbVgkbx8iXY7Wzh3fw=
12
+ - secure: dyg7H8qxQGJKQj7gyVaozn66Fy20Pi+7JBc9bssEUDs6UnLZSjhQRtC08hvN6ds+v1qOwmUihJUVWFsW74bTx9ZZJJk9YBaI4n7Dkh+m3+VnX/idUAHiaF7itjbXkHKmenNyyV5yHcjQsM48lF39CJxexjqv6BkBCgItUJcebMo=
data/Gemfile ADDED
@@ -0,0 +1,26 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Declare your gem's dependencies in kuva.gemspec.
4
+ # Bundler will treat runtime dependencies like base dependencies, and
5
+ # development dependencies will be added by default to the :development group.
6
+ gemspec
7
+
8
+ # Declare any dependencies that are still in development here instead of in
9
+ # your gemspec. These might include edge Rails or gems from your path or
10
+ # Git. Remember to move these dependencies to your gemspec before releasing
11
+ # your gem to rubygems.org.
12
+
13
+ group :development, :test do
14
+ gem "dotenv-rails"
15
+ gem "rspec-rails"
16
+ gem "sqlite3"
17
+ end
18
+
19
+ group :test do
20
+ gem "capybara"
21
+ gem "vcr"
22
+ gem "webmock"
23
+ gem "ammeter"
24
+ gem "simplecov"
25
+ gem "coveralls"
26
+ end
@@ -0,0 +1,187 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ kuva (0.0.1)
5
+ coffee-rails (~> 4.0.0)
6
+ compass-rails
7
+ flickraw
8
+ haml
9
+ rails (~> 4.1.0)
10
+ sass-rails (~> 4.0.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ actionmailer (4.1.0)
16
+ actionpack (= 4.1.0)
17
+ actionview (= 4.1.0)
18
+ mail (~> 2.5.4)
19
+ actionpack (4.1.0)
20
+ actionview (= 4.1.0)
21
+ activesupport (= 4.1.0)
22
+ rack (~> 1.5.2)
23
+ rack-test (~> 0.6.2)
24
+ actionview (4.1.0)
25
+ activesupport (= 4.1.0)
26
+ builder (~> 3.1)
27
+ erubis (~> 2.7.0)
28
+ activemodel (4.1.0)
29
+ activesupport (= 4.1.0)
30
+ builder (~> 3.1)
31
+ activerecord (4.1.0)
32
+ activemodel (= 4.1.0)
33
+ activesupport (= 4.1.0)
34
+ arel (~> 5.0.0)
35
+ activesupport (4.1.0)
36
+ i18n (~> 0.6, >= 0.6.9)
37
+ json (~> 1.7, >= 1.7.7)
38
+ minitest (~> 5.1)
39
+ thread_safe (~> 0.1)
40
+ tzinfo (~> 1.1)
41
+ addressable (2.3.6)
42
+ ammeter (1.0.0)
43
+ activesupport (>= 3.0)
44
+ railties (>= 3.0)
45
+ rspec-rails (>= 2.2)
46
+ arel (5.0.0)
47
+ builder (3.2.2)
48
+ capybara (2.2.1)
49
+ mime-types (>= 1.16)
50
+ nokogiri (>= 1.3.3)
51
+ rack (>= 1.0.0)
52
+ rack-test (>= 0.5.4)
53
+ xpath (~> 2.0)
54
+ chunky_png (1.3.0)
55
+ coffee-rails (4.0.1)
56
+ coffee-script (>= 2.2.0)
57
+ railties (>= 4.0.0, < 5.0)
58
+ coffee-script (2.2.0)
59
+ coffee-script-source
60
+ execjs
61
+ coffee-script-source (1.7.0)
62
+ compass (0.12.5)
63
+ chunky_png (~> 1.2)
64
+ fssm (>= 0.2.7)
65
+ sass (~> 3.2.19)
66
+ compass-rails (1.1.7)
67
+ compass (>= 0.12.2)
68
+ sprockets (<= 2.11.0)
69
+ coveralls (0.7.0)
70
+ multi_json (~> 1.3)
71
+ rest-client
72
+ simplecov (>= 0.7)
73
+ term-ansicolor
74
+ thor
75
+ crack (0.4.2)
76
+ safe_yaml (~> 1.0.0)
77
+ diff-lcs (1.2.5)
78
+ docile (1.1.3)
79
+ dotenv (0.10.0)
80
+ dotenv-rails (0.10.0)
81
+ dotenv (= 0.10.0)
82
+ erubis (2.7.0)
83
+ execjs (2.0.2)
84
+ flickraw (0.9.8)
85
+ fssm (0.2.10)
86
+ haml (4.0.5)
87
+ tilt
88
+ hike (1.2.3)
89
+ i18n (0.6.9)
90
+ json (1.8.1)
91
+ mail (2.5.4)
92
+ mime-types (~> 1.16)
93
+ treetop (~> 1.4.8)
94
+ mime-types (1.25.1)
95
+ mini_portile (0.5.3)
96
+ minitest (5.3.2)
97
+ multi_json (1.9.2)
98
+ nokogiri (1.6.1)
99
+ mini_portile (~> 0.5.0)
100
+ polyglot (0.3.4)
101
+ rack (1.5.2)
102
+ rack-test (0.6.2)
103
+ rack (>= 1.0)
104
+ rails (4.1.0)
105
+ actionmailer (= 4.1.0)
106
+ actionpack (= 4.1.0)
107
+ actionview (= 4.1.0)
108
+ activemodel (= 4.1.0)
109
+ activerecord (= 4.1.0)
110
+ activesupport (= 4.1.0)
111
+ bundler (>= 1.3.0, < 2.0)
112
+ railties (= 4.1.0)
113
+ sprockets-rails (~> 2.0)
114
+ railties (4.1.0)
115
+ actionpack (= 4.1.0)
116
+ activesupport (= 4.1.0)
117
+ rake (>= 0.8.7)
118
+ thor (>= 0.18.1, < 2.0)
119
+ rake (10.2.2)
120
+ rest-client (1.6.7)
121
+ mime-types (>= 1.16)
122
+ rspec-core (2.14.8)
123
+ rspec-expectations (2.14.5)
124
+ diff-lcs (>= 1.1.3, < 2.0)
125
+ rspec-mocks (2.14.6)
126
+ rspec-rails (2.14.2)
127
+ actionpack (>= 3.0)
128
+ activemodel (>= 3.0)
129
+ activesupport (>= 3.0)
130
+ railties (>= 3.0)
131
+ rspec-core (~> 2.14.0)
132
+ rspec-expectations (~> 2.14.0)
133
+ rspec-mocks (~> 2.14.0)
134
+ safe_yaml (1.0.2)
135
+ sass (3.2.19)
136
+ sass-rails (4.0.3)
137
+ railties (>= 4.0.0, < 5.0)
138
+ sass (~> 3.2.0)
139
+ sprockets (~> 2.8, <= 2.11.0)
140
+ sprockets-rails (~> 2.0)
141
+ simplecov (0.8.2)
142
+ docile (~> 1.1.0)
143
+ multi_json
144
+ simplecov-html (~> 0.8.0)
145
+ simplecov-html (0.8.0)
146
+ sprockets (2.11.0)
147
+ hike (~> 1.2)
148
+ multi_json (~> 1.0)
149
+ rack (~> 1.0)
150
+ tilt (~> 1.1, != 1.3.0)
151
+ sprockets-rails (2.1.3)
152
+ actionpack (>= 3.0)
153
+ activesupport (>= 3.0)
154
+ sprockets (~> 2.8)
155
+ sqlite3 (1.3.9)
156
+ term-ansicolor (1.3.0)
157
+ tins (~> 1.0)
158
+ thor (0.19.1)
159
+ thread_safe (0.3.3)
160
+ tilt (1.4.1)
161
+ tins (1.1.0)
162
+ treetop (1.4.15)
163
+ polyglot
164
+ polyglot (>= 0.3.1)
165
+ tzinfo (1.1.0)
166
+ thread_safe (~> 0.1)
167
+ vcr (2.9.0)
168
+ webmock (1.17.3)
169
+ addressable (>= 2.2.7)
170
+ crack (>= 0.3.2)
171
+ xpath (2.0.0)
172
+ nokogiri (~> 1.3)
173
+
174
+ PLATFORMS
175
+ ruby
176
+
177
+ DEPENDENCIES
178
+ ammeter
179
+ capybara
180
+ coveralls
181
+ dotenv-rails
182
+ kuva!
183
+ rspec-rails
184
+ simplecov
185
+ sqlite3
186
+ vcr
187
+ webmock
@@ -0,0 +1,20 @@
1
+ Copyright 2014 Kevin Tuhumury
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,129 @@
1
+ # Kuva
2
+
3
+ [![Build Status](https://travis-ci.org/kevintuhumury/kuva.png)](https://travis-ci.org/kevintuhumury/kuva)
4
+ [![Dependency Status](https://gemnasium.com/kevintuhumury/kuva.png)](https://gemnasium.com/kevintuhumury/kuva)
5
+ [![Code Climate](https://codeclimate.com/github/kevintuhumury/kuva.png)](https://codeclimate.com/github/kevintuhumury/kuva)
6
+ [![Coverage Status](https://coveralls.io/repos/kevintuhumury/kuva/badge.png)](https://coveralls.io/r/kevintuhumury/kuva)
7
+
8
+ A Flickr gallery which can be mounted as a Rails engine. Once mounted, you can view your own photosets and its photos. This is offered in its current state, but [new features](https://github.com/kevintuhumury/kuva#wishlist) will be added as soon as possible (or you can [contribute](https://github.com/kevintuhumury/kuva#contributing) to this gem)
9
+
10
+ ## Installation
11
+
12
+ Add this line to your application's Gemfile:
13
+
14
+ gem 'kuva'
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself:
21
+
22
+ $ gem install kuva
23
+
24
+ ## Authorize Kuva
25
+
26
+ To use Kuva you'll need to authorize the gem with Flickr. In order to do that, you'll need to apply for an API key and shared secret. When that's done, you'll need to run the `kuva:authorize` rake task, but first things first.
27
+
28
+ ### Apply for an API key and shared secret
29
+
30
+ You can retrieve an API key and shared secret from Flickr by [creating a new application](https://www.flickr.com/services/apps). Just follow the instructions and once you've received the API key and shared secret, move on to the next step.
31
+
32
+ ### Run the `kuva:authorize` rake task
33
+
34
+ rake kuva:authorize
35
+
36
+ Something like the following will be shown to you:
37
+
38
+ Copy the URL below and follow the steps on Flickr to authorize Kuva:
39
+ https://api.flickr.com/services/oauth/authorize?oauth_token=OAUTH_TOKEN&perms=read
40
+
41
+ Once you've authorized Kuva, you'll receive a code (in the form of xxx-xxx-xxx) from Flickr. Copy and paste that code here and press <enter>:
42
+
43
+ Copy the URL (as requested) and paste it in your browser. Next copy the code (xxx-xxx-xxx) from Flickr, paste it in your shell and press enter. Once you've done that, you'll receive the access token and access token secret from Flickr:
44
+
45
+ USERNAME, you've successfully authorized Kuva with Flickr. As you can see we've received your username. Besides that we've got the following access token 'ACCESS_TOKEN' and access secret 'ACCESS_SECRET'. Both the API key, shared secret and the previously mentioned variables should be saved for later use. They're all listed below. Place them in `config/initializers/kuva.rb` and you're good to go.
46
+
47
+ api_key: API_KEY
48
+ shared_secret: SHARED_SECRET
49
+ access_token: ACCESS_TOKEN
50
+ access_secret: ACCESS_SECRET
51
+
52
+
53
+ Take note of the variables and save them, since you'll need them to use Kuva.
54
+
55
+ ## Configuration
56
+
57
+ Now that we've got the required variables, let's put them to use. Configuring Kuva is pretty easy. First run the following:
58
+
59
+ rails generate kuva:install
60
+
61
+ This will install an initializer called `config/initializer/kuva.rb` in your Rails application. Use the previously acquired variables to fill in the Kuva setup block in that file.
62
+
63
+ Besides the `API key`, `shared secret`, `access token` and `access token secret` you're able to set the `cache expiration` of the Flickr API calls as well.
64
+
65
+ That's it!
66
+
67
+ ### Configuring your development environment
68
+
69
+ When you decide to contribute to this gem, the first thing you need to do (obviously) is follow the [contributing](https://github.com/kevintuhumury/kuva#contributing) rules.
70
+
71
+ The next thing is setting up your development environment. To do that, you'll need an API key and shared secret. When you've got them, you can put them to use:
72
+
73
+ mv .env.example .env
74
+
75
+ Now fill in the Flickr variables in the `.env` file. This file will be used by RSpec (more specifically the `spec_helper.rb` file) to make the Flickr API calls by setting the values as environment variables.
76
+
77
+ ## Customization
78
+
79
+ If you're like me, you'll want to adjust the default (basic) functionality (or at least the views). Good news, you can do that!
80
+
81
+ ### Adjusting the i18n labels
82
+
83
+ The `kuva:install` command (which you should've run by now) also installed a locale (called `config/locales/en/kuva.yml`) which contains the labels for the Kuva views. When you would like to adjust them, you now know where to look.
84
+
85
+ ### Adjusting the default views
86
+
87
+ Whenever you would like to adjust the default Kuva views, you can. Simply run the following command on the command line:
88
+
89
+ rails generate kuva:views
90
+
91
+ This will copy all the default views to your application. They'll be placed in the `app/views/kuva` directory. Once that's done you can edit them to your liking.
92
+
93
+ ## Example usage of Kuva
94
+
95
+ If you would like to see the Kuva Rails engine in action, you can checkout the following website: [NewMediaFreak](http://www.newmediafreak.nl/fotografie). I've (it's my personal website) adjusted the views a bit though.
96
+
97
+ ## Contributing
98
+
99
+ You're very welcome to contribute to this gem. To do so, please follow these steps:
100
+
101
+ 1. Fork this project
102
+ 2. Clone your fork on your local machine
103
+ 3. Install the development dependencies with `bundle install`
104
+ 4. Follow the above steps to request your own API key and shared secret
105
+ 5. Follow the above steps to configure the Kuva Rails engine
106
+ 6. Follow the above steps to configure your development environment
107
+ 7. Create your feature branch with `git checkout -b my-new-feature`
108
+ 8. Run the specs with `rspec` and make sure everything is covered with RSpec
109
+ 9. Commit your changes `git commit -am 'Added new feature'`
110
+ 10. Push to your branch `git push origin my-new-feature`
111
+ 11. Create a new Pull Request
112
+
113
+ ## Wishlist
114
+
115
+ Kuva has some basic functionality, but it can always be improved. Some features that might be useful:
116
+
117
+ - Pagination (e.g. kaminari) on the photoset collection and photoset view (when you've got a lot of photoset or photos)
118
+ - Navigating through the photosets and photos (going to the next one)
119
+ - Adding a photostream
120
+ - Adding exif data to the photo view
121
+ - Adding geo data to the photo view
122
+ - Adding tags (including filtering by those tags)
123
+ - Adding comments (or simply showing them)
124
+
125
+ When you would like to contribute, but you're not sure what to add, pick something from the list above. If you start on one of them, please [add a new issue](https://github.com/kevintuhumury/kuva/issues/new) (to claim a feature), so that we don't get multiple pull requests for the same functionality.
126
+
127
+ ## Copyright
128
+
129
+ Copyright 2014 Kevin Tuhumury. Released under the MIT License.
@@ -0,0 +1,14 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
8
+ load 'rails/tasks/engine.rake'
9
+
10
+ require 'rspec/core/rake_task'
11
+ RSpec::Core::RakeTask.new(:spec)
12
+ task default: :spec
13
+
14
+ Bundler::GemHelper.install_tasks
File without changes
@@ -0,0 +1,13 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file.
9
+ //
10
+ // Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require_tree .