feedy 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/feedy/feedback_helper.rb +1 -1
- data/app/views/feedy/feedbacks/_feedback.html.erb +1 -1
- data/app/views/feedy/feedbacks/_form.html.erb +1 -1
- data/lib/feedy.rb +3 -3
- data/lib/feedy/version.rb +1 -1
- data/lib/generators/feedy/install/templates/initializer.rb +2 -2
- data/lib/generators/feedy/install_generator.rb +27 -5
- metadata +5 -6
- data/lib/generators/feedy/install/templates/migration.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3c5ad420932660bfcba62c74c9a0faffa58cacf
|
4
|
+
data.tar.gz: be9276fdd7cafaf29d0d844f77d81e1e70e16712
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1fc2ede3b94964d8d1229cfda327753d2e67646c10f408ec93da57beb633d3e31ce3be587ff23efa48822675c1dd729c74f8af6ff37358e497db95474000600
|
7
|
+
data.tar.gz: a7bf34fee4deabc8a2637d8d58283548046c805a5825549aa90875558815f63a1a633c8eb135411252c4a6944d525d0f50048fc65bfd05a0d13617c33df3f24a
|
@@ -4,7 +4,7 @@
|
|
4
4
|
</div>
|
5
5
|
|
6
6
|
<div class="feedback-input">
|
7
|
-
<%= form_for :feedback, url: feedy.
|
7
|
+
<%= form_for :feedback, url: feedy.feedbacks_path, html: { id: 'feedback-form' }, remote: true do |f| %>
|
8
8
|
<%= f.label :subject %>
|
9
9
|
<%= f.text_field :subject %>
|
10
10
|
|
data/lib/feedy.rb
CHANGED
@@ -2,7 +2,7 @@ require "feedy/engine"
|
|
2
2
|
require "active_support"
|
3
3
|
|
4
4
|
module Feedy
|
5
|
-
|
5
|
+
|
6
6
|
mattr_accessor :user_class, :current_user_helper, :anonymous_feedback
|
7
7
|
|
8
8
|
class << self
|
@@ -14,7 +14,7 @@ module Feedy
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def user_class
|
17
|
-
Object.const_get(@@user_class)
|
17
|
+
Object.const_get(@@user_class) if @@user_class
|
18
18
|
end
|
19
19
|
|
20
20
|
def current_user_helper
|
@@ -28,5 +28,5 @@ module Feedy
|
|
28
28
|
end
|
29
29
|
|
30
30
|
ActiveSupport.on_load(:active_record) do
|
31
|
-
Feedy.extend_user_class!
|
31
|
+
Feedy.extend_user_class! if Feedy.user_class
|
32
32
|
end
|
data/lib/feedy/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
Feedy.anonymous_feedback = false
|
2
|
-
Feedy.user_class = "
|
3
|
-
Feedy.current_user_helper =
|
2
|
+
Feedy.user_class = "<%= user_class %>"
|
3
|
+
Feedy.current_user_helper = :<%= current_user_helper %>
|
@@ -5,17 +5,39 @@ module Feedy
|
|
5
5
|
class InstallGenerator < Rails::Generators::Base
|
6
6
|
include Rails::Generators::Migration
|
7
7
|
|
8
|
+
class_option 'user_class', type: :string
|
9
|
+
class_option 'current_user_helper', type: :string
|
10
|
+
|
11
|
+
attr_reader :user_class, :current_user_helper
|
12
|
+
|
8
13
|
source_root File.expand_path("../install/templates", __FILE__)
|
9
|
-
desc "Copies Feedy migrations"
|
14
|
+
desc "Copies Feedy migrations and the initializer"
|
10
15
|
|
11
|
-
def
|
12
|
-
|
16
|
+
def copy_migration_file
|
17
|
+
Dir.chdir(Rails.root) do
|
18
|
+
`rake feedy:install:migrations`
|
19
|
+
end
|
13
20
|
end
|
14
21
|
|
15
|
-
def
|
16
|
-
|
22
|
+
def determine_user_class
|
23
|
+
@user_class = options["user_class"].presence ||
|
24
|
+
ask("What is your user class called? [User]").presence ||
|
25
|
+
"User"
|
17
26
|
end
|
18
27
|
|
28
|
+
def determine_current_user_helper
|
29
|
+
@current_user_helper = options["current_user_helper"].presence ||
|
30
|
+
ask("What is the current user helper in your application? [current_user]").presence ||
|
31
|
+
'current_user'
|
32
|
+
end
|
33
|
+
|
34
|
+
def copy_initializer
|
35
|
+
template 'initializer.rb', 'config/initializers/feedy.rb'
|
36
|
+
end
|
37
|
+
|
38
|
+
def mount_engine
|
39
|
+
route 'mount Feedy::Engine, at: "/feedy"'
|
40
|
+
end
|
19
41
|
end
|
20
42
|
end
|
21
43
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feedy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sung Won Cho
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: jquery-rails
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: sqlite3
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -151,7 +151,6 @@ files:
|
|
151
151
|
- lib/feedy/engine.rb
|
152
152
|
- lib/feedy/version.rb
|
153
153
|
- lib/generators/feedy/install/templates/initializer.rb
|
154
|
-
- lib/generators/feedy/install/templates/migration.rb
|
155
154
|
- lib/generators/feedy/install_generator.rb
|
156
155
|
- lib/tasks/feedy_tasks.rake
|
157
156
|
homepage: https://github.com/sungwoncho/feedy
|
@@ -1,16 +0,0 @@
|
|
1
|
-
class CreateFeedbacks < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
create_table :feedbacks do |t|
|
4
|
-
t.references :feedback_giver, polymorphic: true
|
5
|
-
t.text :subject
|
6
|
-
t.text :body
|
7
|
-
|
8
|
-
t.timestamps
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.down
|
13
|
-
drop_table :feedbacks
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|