vibrant 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -0
  3. data/.rspec +2 -0
  4. data/CODE_OF_CONDUCT.md +13 -0
  5. data/Gemfile +4 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +67 -0
  8. data/Rakefile +1 -0
  9. data/bin/console +14 -0
  10. data/bin/setup +7 -0
  11. data/examples/.gitignore +17 -0
  12. data/examples/Gemfile +18 -0
  13. data/examples/Gemfile.lock +135 -0
  14. data/examples/README.rdoc +28 -0
  15. data/examples/Rakefile +6 -0
  16. data/examples/app/assets/images/.keep +0 -0
  17. data/examples/app/assets/javascripts/application.coffee +1 -0
  18. data/examples/app/assets/javascripts/home.coffee +0 -0
  19. data/examples/app/assets/stylesheets/application.css +15 -0
  20. data/examples/app/assets/stylesheets/home.scss +3 -0
  21. data/examples/app/controllers/application_controller.rb +3 -0
  22. data/examples/app/controllers/concerns/.keep +0 -0
  23. data/examples/app/controllers/home_controller.rb +20 -0
  24. data/examples/app/helpers/application_helper.rb +2 -0
  25. data/examples/app/helpers/home_helper.rb +2 -0
  26. data/examples/app/mailers/.keep +0 -0
  27. data/examples/app/models/.keep +0 -0
  28. data/examples/app/models/concerns/.keep +0 -0
  29. data/examples/app/uploaders/photo_uploader.rb +51 -0
  30. data/examples/app/views/home/index.html.erb +26 -0
  31. data/examples/app/views/layouts/application.html.erb +14 -0
  32. data/examples/bin/bundle +3 -0
  33. data/examples/bin/rails +8 -0
  34. data/examples/bin/rake +8 -0
  35. data/examples/bin/setup +29 -0
  36. data/examples/bin/spring +15 -0
  37. data/examples/config.ru +4 -0
  38. data/examples/config/application.rb +29 -0
  39. data/examples/config/boot.rb +3 -0
  40. data/examples/config/database.yml +25 -0
  41. data/examples/config/environment.rb +5 -0
  42. data/examples/config/environments/development.rb +41 -0
  43. data/examples/config/environments/production.rb +79 -0
  44. data/examples/config/environments/test.rb +42 -0
  45. data/examples/config/initializers/assets.rb +11 -0
  46. data/examples/config/initializers/backtrace_silencers.rb +7 -0
  47. data/examples/config/initializers/cookies_serializer.rb +3 -0
  48. data/examples/config/initializers/filter_parameter_logging.rb +4 -0
  49. data/examples/config/initializers/inflections.rb +16 -0
  50. data/examples/config/initializers/mime_types.rb +4 -0
  51. data/examples/config/initializers/session_store.rb +3 -0
  52. data/examples/config/initializers/wrap_parameters.rb +14 -0
  53. data/examples/config/locales/en.yml +23 -0
  54. data/examples/config/routes.rb +6 -0
  55. data/examples/config/secrets.yml +22 -0
  56. data/examples/db/seeds.rb +7 -0
  57. data/examples/lib/assets/.keep +0 -0
  58. data/examples/lib/tasks/.keep +0 -0
  59. data/examples/log/.keep +0 -0
  60. data/examples/public/1.jpg +0 -0
  61. data/examples/public/2.jpg +0 -0
  62. data/examples/public/3.jpg +0 -0
  63. data/examples/public/4.jpg +0 -0
  64. data/examples/public/404.html +67 -0
  65. data/examples/public/422.html +67 -0
  66. data/examples/public/500.html +66 -0
  67. data/examples/public/favicon.ico +0 -0
  68. data/examples/public/octocat.png +0 -0
  69. data/examples/public/robots.txt +5 -0
  70. data/examples/test/controllers/.keep +0 -0
  71. data/examples/test/controllers/home_controller_test.rb +9 -0
  72. data/examples/test/fixtures/.keep +0 -0
  73. data/examples/test/helpers/.keep +0 -0
  74. data/examples/test/integration/.keep +0 -0
  75. data/examples/test/mailers/.keep +0 -0
  76. data/examples/test/models/.keep +0 -0
  77. data/examples/test/test_helper.rb +10 -0
  78. data/examples/vendor/assets/javascripts/.keep +0 -0
  79. data/examples/vendor/assets/stylesheets/.keep +0 -0
  80. data/images/1.jpg +0 -0
  81. data/images/2.jpg +0 -0
  82. data/images/3.jpg +0 -0
  83. data/images/4.jpg +0 -0
  84. data/images/octocat.png +0 -0
  85. data/lib/vibrant.rb +15 -0
  86. data/lib/vibrant/swatch.rb +55 -0
  87. data/lib/vibrant/version.rb +4 -0
  88. data/lib/vibrant/vibrant.rb +177 -0
  89. data/vibrant-rb.gemspec +25 -0
  90. metadata +174 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 63e4027af922a5ed4d54a8f98ca2059fad032ca3
4
+ data.tar.gz: 3d16953df254c8814ef0df00dbcc3c2becf88448
5
+ SHA512:
6
+ metadata.gz: 0e017365963522dd42d2ddc8aa73552107a3fad243ea5259648ec019ca908baa3e37d66d0ebe543832682fb25d7dc58182aa29b128b63fadef79b5e1229fbb12
7
+ data.tar.gz: 836c7c72066d4ee9581560441249fe16f0fdfb4429a37161c7cd7fe8ee1cbdb346689e529ca7b7bd1d5243cd81c8e8718ab7eb2c91e340817094a3353dfcf776
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ /sample/
11
+ /.idea/
12
+ **/*.iml
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --require spec_helper
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in vibrant-rb.gemspec
4
+ gemspec
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 dondoco7
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,67 @@
1
+ [![Gem Version](https://badge.fury.io/rb/vibrant-rb.svg)](https://badge.fury.io/rb/vibrant-rb)
2
+
3
+ # Vibrant::Rb
4
+
5
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/vibrant/rb`. To experiment with that code, run `bin/console` for an interactive prompt.
6
+
7
+ TODO: Delete this and the text above, and describe your gem
8
+
9
+ ## Installation
10
+
11
+ Add this line to your application's Gemfile:
12
+
13
+ ```ruby
14
+ gem 'vibrant-rb'
15
+ ```
16
+
17
+ And then execute:
18
+
19
+ $ bundle
20
+
21
+ Or install it yourself as:
22
+
23
+ $ gem install vibrant-rb
24
+
25
+ ## Usage
26
+
27
+ ### Install
28
+
29
+ ```
30
+ gem install vibrant
31
+ ```
32
+ or
33
+ ```
34
+ gem 'vibrant'
35
+ ```
36
+
37
+ ### Use
38
+ ```
39
+
40
+ # path or file
41
+ vibrant = Vibrant.read('images/octocat.png')
42
+
43
+ # get colors
44
+ vibrant = vibrant.vibrant.hex
45
+ muted = vibrant.muted.hex
46
+ dark_vibrant = vibrant.dark_vibrant.hex
47
+ dark_muted = vibrant.dark_muted.hex
48
+ light_vibrant = vibrant.light_vibrant.hex
49
+ light_muted = vibrant.light_muted.hex
50
+ ```
51
+ TODO: Write usage instructions here
52
+
53
+ ## Development
54
+
55
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
56
+
57
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
58
+
59
+ ## Contributing
60
+
61
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/vibrant-rb. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
62
+
63
+
64
+ ## License
65
+
66
+ The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
67
+
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "vibrant/rb"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,17 @@
1
+ # See https://help.github.com/articles/ignoring-files for more about ignoring files.
2
+ #
3
+ # If you find yourself ignoring temporary files generated by your text editor
4
+ # or operating system, you probably want to add a global ignore instead:
5
+ # git config --global core.excludesfile '~/.gitignore_global'
6
+
7
+ # Ignore bundler config.
8
+ /.bundle
9
+
10
+ # Ignore the default SQLite database.
11
+ /db/*.sqlite3
12
+ /db/*.sqlite3-journal
13
+
14
+ # Ignore all logfiles and tempfiles.
15
+ /log/*
16
+ !/log/.keep
17
+ /tmp
@@ -0,0 +1,18 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', '4.2.4'
4
+ gem 'sqlite3'
5
+ gem 'sass-rails', '~> 5.0'
6
+ gem 'uglifier', '>= 1.3.0'
7
+ gem 'coffee-rails', '~> 4.1.0'
8
+ gem 'carrierwave'
9
+ gem 'rmagick'
10
+
11
+ group :development, :test do
12
+ gem 'byebug'
13
+ end
14
+
15
+ group :development do
16
+ #gem 'spring'
17
+ end
18
+
@@ -0,0 +1,135 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ actionmailer (4.2.4)
5
+ actionpack (= 4.2.4)
6
+ actionview (= 4.2.4)
7
+ activejob (= 4.2.4)
8
+ mail (~> 2.5, >= 2.5.4)
9
+ rails-dom-testing (~> 1.0, >= 1.0.5)
10
+ actionpack (4.2.4)
11
+ actionview (= 4.2.4)
12
+ activesupport (= 4.2.4)
13
+ rack (~> 1.6)
14
+ rack-test (~> 0.6.2)
15
+ rails-dom-testing (~> 1.0, >= 1.0.5)
16
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
17
+ actionview (4.2.4)
18
+ activesupport (= 4.2.4)
19
+ builder (~> 3.1)
20
+ erubis (~> 2.7.0)
21
+ rails-dom-testing (~> 1.0, >= 1.0.5)
22
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
23
+ activejob (4.2.4)
24
+ activesupport (= 4.2.4)
25
+ globalid (>= 0.3.0)
26
+ activemodel (4.2.4)
27
+ activesupport (= 4.2.4)
28
+ builder (~> 3.1)
29
+ activerecord (4.2.4)
30
+ activemodel (= 4.2.4)
31
+ activesupport (= 4.2.4)
32
+ arel (~> 6.0)
33
+ activesupport (4.2.4)
34
+ i18n (~> 0.7)
35
+ json (~> 1.7, >= 1.7.7)
36
+ minitest (~> 5.1)
37
+ thread_safe (~> 0.3, >= 0.3.4)
38
+ tzinfo (~> 1.1)
39
+ arel (6.0.3)
40
+ builder (3.2.2)
41
+ byebug (8.0.0)
42
+ carrierwave (0.10.0)
43
+ activemodel (>= 3.2.0)
44
+ activesupport (>= 3.2.0)
45
+ json (>= 1.7)
46
+ mime-types (>= 1.16)
47
+ coffee-rails (4.1.0)
48
+ coffee-script (>= 2.2.0)
49
+ railties (>= 4.0.0, < 5.0)
50
+ coffee-script (2.4.1)
51
+ coffee-script-source
52
+ execjs
53
+ coffee-script-source (1.9.1.1)
54
+ erubis (2.7.0)
55
+ execjs (2.6.0)
56
+ globalid (0.3.6)
57
+ activesupport (>= 4.1.0)
58
+ i18n (0.7.0)
59
+ json (1.8.3)
60
+ loofah (2.0.3)
61
+ nokogiri (>= 1.5.9)
62
+ mail (2.6.3)
63
+ mime-types (>= 1.16, < 3)
64
+ mime-types (2.6.2)
65
+ mini_portile (0.6.2)
66
+ minitest (5.8.2)
67
+ nokogiri (1.6.6.2)
68
+ mini_portile (~> 0.6.0)
69
+ rack (1.6.4)
70
+ rack-test (0.6.3)
71
+ rack (>= 1.0)
72
+ rails (4.2.4)
73
+ actionmailer (= 4.2.4)
74
+ actionpack (= 4.2.4)
75
+ actionview (= 4.2.4)
76
+ activejob (= 4.2.4)
77
+ activemodel (= 4.2.4)
78
+ activerecord (= 4.2.4)
79
+ activesupport (= 4.2.4)
80
+ bundler (>= 1.3.0, < 2.0)
81
+ railties (= 4.2.4)
82
+ sprockets-rails
83
+ rails-deprecated_sanitizer (1.0.3)
84
+ activesupport (>= 4.2.0.alpha)
85
+ rails-dom-testing (1.0.7)
86
+ activesupport (>= 4.2.0.beta, < 5.0)
87
+ nokogiri (~> 1.6.0)
88
+ rails-deprecated_sanitizer (>= 1.0.1)
89
+ rails-html-sanitizer (1.0.2)
90
+ loofah (~> 2.0)
91
+ railties (4.2.4)
92
+ actionpack (= 4.2.4)
93
+ activesupport (= 4.2.4)
94
+ rake (>= 0.8.7)
95
+ thor (>= 0.18.1, < 2.0)
96
+ rake (10.4.2)
97
+ rmagick (2.15.4)
98
+ sass (3.4.19)
99
+ sass-rails (5.0.4)
100
+ railties (>= 4.0.0, < 5.0)
101
+ sass (~> 3.1)
102
+ sprockets (>= 2.8, < 4.0)
103
+ sprockets-rails (>= 2.0, < 4.0)
104
+ tilt (>= 1.1, < 3)
105
+ sprockets (3.4.0)
106
+ rack (> 1, < 3)
107
+ sprockets-rails (2.3.3)
108
+ actionpack (>= 3.0)
109
+ activesupport (>= 3.0)
110
+ sprockets (>= 2.8, < 4.0)
111
+ sqlite3 (1.3.11)
112
+ thor (0.19.1)
113
+ thread_safe (0.3.5)
114
+ tilt (2.0.1)
115
+ tzinfo (1.2.2)
116
+ thread_safe (~> 0.1)
117
+ uglifier (2.7.2)
118
+ execjs (>= 0.3.0)
119
+ json (>= 1.8.0)
120
+
121
+ PLATFORMS
122
+ ruby
123
+
124
+ DEPENDENCIES
125
+ byebug
126
+ carrierwave
127
+ coffee-rails (~> 4.1.0)
128
+ rails (= 4.2.4)
129
+ rmagick
130
+ sass-rails (~> 5.0)
131
+ sqlite3
132
+ uglifier (>= 1.3.0)
133
+
134
+ BUNDLED WITH
135
+ 1.10.6
@@ -0,0 +1,28 @@
1
+ == README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
25
+
26
+
27
+ Please feel free to use a different markup language if you do not plan to run
28
+ <tt>rake doc:app</tt>.
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require File.expand_path('../config/application', __FILE__)
5
+
6
+ Rails.application.load_tasks
File without changes
@@ -0,0 +1 @@
1
+ #= require_tree .
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any styles
10
+ * defined in the other CSS/SCSS files in this directory. It is generally better to create a new
11
+ * file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,3 @@
1
+ // Place all the styles related to the home controller here.
2
+ // They will automatically be included in application.css.
3
+ // You can use Sass (SCSS) here: http://sass-lang.com/
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,20 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+
4
+ @types = [
5
+ :vibrant,
6
+ :muted,
7
+ :dark_vibrant,
8
+ :dark_muted,
9
+ :light_vibrant,
10
+ :light_muted
11
+ ]
12
+
13
+ @png_path ='octocat.png'
14
+ @png_vibrant = Vibrant.read(Rails.public_path.join(@png_path))
15
+
16
+ @jpg_path = '1.jpg'
17
+ @jpg_vibrant = Vibrant.read(Rails.public_path.join(@jpg_path))
18
+
19
+ end
20
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ module HomeHelper
2
+ end
File without changes
File without changes