meyasubako 0.0.1 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fcdf5c629bc103c25e023658da5225c098cd94e9
4
- data.tar.gz: 620f0e25280f2ffdf71bf9fb5d6a1733a56310e9
3
+ metadata.gz: faa2de8712bf79bf8d88ba8bd7f42a38d9ab4796
4
+ data.tar.gz: 5aa428a175b24624e678747d856498021ae28fa6
5
5
  SHA512:
6
- metadata.gz: ac248ff7f591350b587acdf28403cbffdc751223ff79a5357e1f7ce27053ecb2fdb19417462428428719bd09400e43ef81aadac824c28005f7c9f280ac382bce
7
- data.tar.gz: 892293ee63a561f780f237a2bcbd99fbf27b5ad51d4dc9c91740411d5f57a8e7c9ea403cc22f7b1c542541c80f7c6b573f44209488e17cb8383069490a6ca768
6
+ metadata.gz: 48caa3981830f60538da2f399c4d3b0e6ffda2eff5bcef602a5f56f0967e9801608ce93a4213b85eddc1a377a3265b17e9755abc8ac02df6d2b9eb020e1b47c2
7
+ data.tar.gz: 6e206b5bceed87859298b76585abe3811b19e8838d48b485580de11f2f8bfca84bc2ed723e0bbc8cf67db4689938792cb2451fa48783c2b5b785b8fa69b4c4d3
@@ -0,0 +1,5 @@
1
+ .bundle/
2
+ pkg/
3
+ spec/dummy/log
4
+ spec/dummy/tmp
5
+ Gemfile.lock
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format documentation
data/Gemfile ADDED
@@ -0,0 +1,7 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ group :development, :test do
6
+ gem 'jquery-rails'
7
+ end
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Meyasubako
2
2
 
3
3
  [![Build Status](https://travis-ci.org/kami30k/meyasubako.svg)](https://travis-ci.org/kami30k/meyasubako)
4
+ [![Gem Version](https://badge.fury.io/rb/meyasubako.svg)](http://badge.fury.io/rb/meyasubako)
4
5
 
5
6
  Meyasubako provides easy to install opinion box for Rails application.
6
7
  The submitted opinion is sent by ActionMailer.
@@ -64,7 +65,7 @@ end
64
65
 
65
66
  ## Customize
66
67
 
67
- If you want to customize the theme color, set `$meyasubako_color` to your `app/assets/stylesheets/application.scss` like this:
68
+ If you want to customize the theme color, set `$meyasubako-color` to your `app/assets/stylesheets/application.scss` like this:
68
69
 
69
70
  ```scss
70
71
  /*
@@ -72,7 +73,7 @@ If you want to customize the theme color, set `$meyasubako_color` to your `app/a
72
73
  *= require_self
73
74
  */
74
75
 
75
- $meyasubako_color: #ffa933;
76
+ $meyasubako-color: #ffa933;
76
77
 
77
78
  @import 'meyasubako';
78
79
  ```
@@ -2,7 +2,7 @@
2
2
  // Customizable variables
3
3
  //
4
4
 
5
- $meyasubako_color: #39c !default;
5
+ $meyasubako-color: #39c !default;
6
6
 
7
7
  .meyasubako {
8
8
  //
@@ -17,7 +17,7 @@ $meyasubako_color: #39c !default;
17
17
  // Variables
18
18
  //
19
19
 
20
- $base_color: darken(mix(#333, $meyasubako_color), 10%);
20
+ $base-color: darken(mix(#333, $meyasubako-color), 10%);
21
21
 
22
22
  //
23
23
  // Styles
@@ -28,7 +28,7 @@ $meyasubako_color: #39c !default;
28
28
  right: 20px;
29
29
  width: 240px;
30
30
  background-color: #fff;
31
- color: $base_color;
31
+ color: $base-color;
32
32
  font-size: 16px;
33
33
  font-family:'Helvetica Neue', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
34
34
  line-height: 1.5;
@@ -37,74 +37,74 @@ $meyasubako_color: #39c !default;
37
37
  box-sizing: border-box;
38
38
  }
39
39
 
40
- #{&}__heading {
40
+ &__heading {
41
41
  cursor: pointer;
42
42
  margin: 0;
43
43
  padding: 8px 0 8px 16px;
44
44
  border-radius: 2px 2px 0 0;
45
- background-color: $meyasubako_color;
45
+ background-color: $meyasubako-color;
46
46
  color: #fff;
47
47
  font-size: 80%;
48
48
  font-weight: normal;
49
49
  transition: 200ms;
50
50
 
51
51
  &:hover {
52
- background-color: darken($meyasubako_color, 5%);
52
+ background-color: darken($meyasubako-color, 5%);
53
53
  color: darken(#fff, 5%);
54
54
  }
55
55
  }
56
56
 
57
- #{&}__container {
57
+ &__container {
58
58
  display: none;
59
59
  overflow: hidden;
60
60
  padding: 16px;
61
- border-right: 1px solid whiten($base_color, 80%);
62
- border-left: 1px solid whiten($base_color, 80%);
61
+ border-right: 1px solid whiten($base-color, 80%);
62
+ border-left: 1px solid whiten($base-color, 80%);
63
63
  }
64
64
 
65
- #{&}__message__container {
65
+ &__message__container {
66
66
  display: none;
67
67
  margin-bottom: 8px;
68
68
  padding: 8px;
69
69
  border-radius: 2px;
70
- background-color: whiten($meyasubako_color, 95%);
71
- color: $meyasubako_color;
70
+ background-color: whiten($meyasubako-color, 95%);
71
+ color: $meyasubako-color;
72
72
  font-size: 70%;
73
73
  }
74
74
 
75
- #{&}__message {
75
+ &__message {
76
76
  margin: 0;
77
77
  }
78
78
 
79
- #{&}__message--success {
79
+ &__message--success {
80
80
  display: none;
81
81
  }
82
82
 
83
- #{&}__content {
83
+ &__content {
84
84
  resize: none;
85
85
  width: 100%;
86
86
  height: 120px;
87
87
  margin-bottom: 8px;
88
88
  padding: 8px;
89
- border: 1px solid whiten($base_color, 80%);
89
+ border: 1px solid whiten($base-color, 80%);
90
90
  border-radius: 2px;
91
- color: $base_color;
91
+ color: $base-color;
92
92
  font-size: 80%;
93
93
  vertical-align: bottom;
94
94
  }
95
95
 
96
- #{&}__submit {
96
+ &__submit {
97
97
  cursor: pointer;
98
98
  float: right;
99
99
  padding: 8px 16px;
100
100
  border: none;
101
101
  border-radius: 2px;
102
- background-color: $meyasubako_color;
102
+ background-color: $meyasubako-color;
103
103
  color: #fff;
104
104
  transition: 200ms;
105
105
 
106
106
  &:hover {
107
- background-color: darken($meyasubako_color, 5%);
107
+ background-color: darken($meyasubako-color, 5%);
108
108
  color: darken(#fff, 5%);
109
109
  }
110
110
  }
@@ -8,7 +8,7 @@ module Meyasubako
8
8
  mail(
9
9
  to: Meyasubako.config.to,
10
10
  from: Meyasubako.config.from,
11
- subject: I18n.t('meyasubako.subject')
11
+ subject: t('meyasubako.subject')
12
12
  )
13
13
  end
14
14
  end
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  module Meyasubako
2
- class Engine < ::Rails::Engine
2
+ class Engine < Rails::Engine
3
3
  isolate_namespace Meyasubako
4
4
 
5
5
  initializer 'meyasubako' do
@@ -1,3 +1,3 @@
1
1
  module Meyasubako
2
- VERSION = '0.0.1'
2
+ VERSION = '0.1.0'
3
3
  end
@@ -0,0 +1,28 @@
1
+ $:.unshift File.expand_path('../lib', __FILE__)
2
+
3
+ require 'meyasubako/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'meyasubako'
7
+ s.version = Meyasubako::VERSION
8
+ s.authors = 'kami'
9
+ s.email = 'kami30k@gmail.com'
10
+ s.homepage = 'https://github.com/kami30k/meyasubako'
11
+ s.summary = 'Easy to install opinion box for Rails application.'
12
+ s.description = 'Easy to install opinion box for Rails application.'
13
+ s.license = 'MIT'
14
+
15
+ s.files = `git ls-files -z`.split("\x0")
16
+
17
+ s.add_dependency 'rails'
18
+ s.add_dependency 'sass-rails'
19
+ s.add_dependency 'coffee-rails'
20
+ s.add_dependency 'jquery-rails'
21
+
22
+ s.add_development_dependency 'sqlite3'
23
+ s.add_development_dependency 'rspec-rails'
24
+ s.add_development_dependency 'capybara'
25
+ s.add_development_dependency 'capybara-email'
26
+ s.add_development_dependency 'poltergeist'
27
+ s.add_development_dependency 'letter_opener_web'
28
+ end
@@ -0,0 +1,15 @@
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 any plugin's vendor/assets/javascripts directory 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 jquery
14
+ //= require meyasubako
15
+ //= require_tree .
@@ -0,0 +1,20 @@
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 meyasubako
14
+ *= require_tree .
15
+ *= require_self
16
+ */
17
+
18
+ // $meyasubako-color: #c93;
19
+
20
+ // @import 'meyasubako';
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Dummy</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1 @@
1
+ <%= render_meyasubako %>
@@ -0,0 +1,53 @@
1
+ $:.unshift File.expand_path('../../../lib', __FILE__)
2
+
3
+ require 'action_controller/railtie'
4
+ require 'action_view/railtie'
5
+ require 'action_mailer/railtie'
6
+ require 'sprockets/railtie'
7
+
8
+ require 'jquery-rails'
9
+ require 'letter_opener_web'
10
+
11
+ require 'meyasubako'
12
+
13
+ module Dummy
14
+ class Application < Rails::Application
15
+ config.secret_token = 'abcdefghijklmnopqrstuvwxyz0123456789'
16
+ config.session_store :cookie_store, key: '_dummy_session'
17
+ config.eager_load = false
18
+ config.active_support.deprecation = :log
19
+
20
+ case Rails.env.to_sym
21
+ when :development
22
+ config.action_mailer.delivery_method = :letter_opener_web
23
+ when :test
24
+ config.action_mailer.delivery_method = :test
25
+ end
26
+ end
27
+ end
28
+
29
+ Dummy::Application.initialize!
30
+
31
+ Dummy::Application.routes.draw do
32
+ mount Meyasubako::Engine => '/meyasubako'
33
+
34
+ if Rails.env.development?
35
+ mount LetterOpenerWeb::Engine => '/letter_opener'
36
+ end
37
+
38
+ root 'pages#index'
39
+ end
40
+
41
+ class ApplicationController < ActionController::Base
42
+ protect_from_forgery with: :exception
43
+ end
44
+
45
+ class PagesController < ApplicationController
46
+ def index
47
+ end
48
+ end
49
+
50
+ Meyasubako.configure do |config|
51
+ config.to = 'test@example.com'
52
+ config.from = 'test@example.com'
53
+ end
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ APP_PATH = File.expand_path('../../application', __FILE__)
4
+
5
+ require 'rails/commands'
@@ -0,0 +1 @@
1
+ run Rails.application
@@ -0,0 +1,36 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'Integration test', type: :feature, js: true do
4
+ let(:container) { find('.meyasubako__container', visible: false) }
5
+ let(:heading) { find('.meyasubako__heading') }
6
+
7
+ before { visit root_path }
8
+
9
+ describe 'toggle box' do
10
+ it 'should toggle the visibility' do
11
+ expect(container).not_to be_visible
12
+
13
+ heading.click
14
+
15
+ expect(container).to be_visible
16
+ end
17
+ end
18
+
19
+ describe 'send opinion' do
20
+ it 'should send correctly' do
21
+ heading.click
22
+
23
+ fill_in :meyasubako__content, with: 'foo'
24
+
25
+ click_on 'Submit'
26
+
27
+ # Wait for sending email
28
+ expect(page).to have_content 'Sending ...'
29
+ expect(page).to have_content 'Thank you for sending your opinion.'
30
+
31
+ open_email 'test@example.com'
32
+
33
+ expect(current_email).to have_content 'foo'
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,16 @@
1
+ ENV['RAILS_ENV'] ||= 'test'
2
+
3
+ require 'dummy/application'
4
+
5
+ require 'rspec/rails'
6
+ require 'capybara/rails'
7
+ require 'capybara/rspec'
8
+ require 'capybara/email/rspec'
9
+ require 'capybara/poltergeist'
10
+
11
+ Capybara.default_driver = :poltergeist
12
+ Capybara.javascript_driver = :poltergeist
13
+
14
+ RSpec.configure do |config|
15
+ config.include Capybara::DSL
16
+ end
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meyasubako
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - kami
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2015-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.2.0
19
+ version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - "~>"
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 4.2.0
26
+ version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sass-rails
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -151,12 +151,14 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  description: Easy to install opinion box for Rails application.
154
- email:
155
- - kami30k@gmail.com
154
+ email: kami30k@gmail.com
156
155
  executables: []
157
156
  extensions: []
158
157
  extra_rdoc_files: []
159
158
  files:
159
+ - ".gitignore"
160
+ - ".rspec"
161
+ - Gemfile
160
162
  - MIT-LICENSE
161
163
  - README.md
162
164
  - Rakefile
@@ -170,10 +172,22 @@ files:
170
172
  - config/locales/en.yml
171
173
  - config/locales/ja.yml
172
174
  - config/routes.rb
175
+ - doc/demo.gif
176
+ - doc/screenshot.png
173
177
  - lib/meyasubako.rb
174
178
  - lib/meyasubako/config.rb
175
179
  - lib/meyasubako/engine.rb
176
180
  - lib/meyasubako/version.rb
181
+ - meyasubako.gemspec
182
+ - spec/dummy/app/assets/javascripts/application.js
183
+ - spec/dummy/app/assets/stylesheets/application.scss
184
+ - spec/dummy/app/views/layouts/application.html.erb
185
+ - spec/dummy/app/views/pages/index.html.erb
186
+ - spec/dummy/application.rb
187
+ - spec/dummy/bin/rails
188
+ - spec/dummy/config.ru
189
+ - spec/requests/meyasubako_pages_spec.rb
190
+ - spec/spec_helper.rb
177
191
  homepage: https://github.com/kami30k/meyasubako
178
192
  licenses:
179
193
  - MIT
@@ -194,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
194
208
  version: '0'
195
209
  requirements: []
196
210
  rubyforge_project:
197
- rubygems_version: 2.2.2
211
+ rubygems_version: 2.4.5
198
212
  signing_key:
199
213
  specification_version: 4
200
214
  summary: Easy to install opinion box for Rails application.