liking 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,17 +8,17 @@ module Liking
8
8
  user_ids = Like.where(:resource_id => resource.id, :resource_type => resource.class).pluck(:user_id)
9
9
 
10
10
  if user_ids.empty?
11
- link_to "<i class='icon-heart'></i> 喜欢".html_safe,
11
+ link_to "<i class='icon-heart'></i> #{t 'liking.like'}".html_safe,
12
12
  liking.polymorphic_path(:like, resource.class.to_s.foreign_key => resource.id),
13
13
  :method => :post,
14
14
  :class => "btn btn-small"
15
15
  elsif current_user and user_ids.include?(current_user.id)
16
- link_to "<i class='icon-heart icon-red'></i> #{user_ids.size}人喜欢".html_safe,
16
+ link_to "<i class='icon-heart icon-red'></i> #{user_ids.size} #{t 'liking.like'}".html_safe,
17
17
  liking.polymorphic_path(:like, resource.class.to_s.foreign_key => resource.id),
18
18
  :method => :delete,
19
19
  :class => "btn btn-small"
20
20
  else
21
- link_to "<i class='icon-heart'></i> #{user_ids.size}人喜欢".html_safe,
21
+ link_to "<i class='icon-heart'></i> #{user_ids.size} #{t 'liking.like'}".html_safe,
22
22
  liking.polymorphic_path(:like, resource.class.to_s.foreign_key => resource.id),
23
23
  :method => :post,
24
24
  :class => "btn btn-small"
@@ -0,0 +1,3 @@
1
+ en:
2
+ liking:
3
+ like: Like
@@ -1,3 +1,3 @@
1
1
  module Liking
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,172 +1,183 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: liking
3
- version: !ruby/object:Gem::Version
4
- version: 0.0.2
3
+ version: !ruby/object:Gem::Version
4
+ hash: 25
5
5
  prerelease:
6
+ segments:
7
+ - 0
8
+ - 0
9
+ - 3
10
+ version: 0.0.3
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - wuwx
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2012-08-25 00:00:00.000000000 Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: rails
16
- requirement: !ruby/object:Gem::Requirement
17
- none: false
18
- requirements:
19
- - - ~>
20
- - !ruby/object:Gem::Version
21
- version: 3.2.8
17
+
18
+ date: 2012-08-27 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
22
21
  type: :runtime
23
- prerelease: false
24
- version_requirements: !ruby/object:Gem::Requirement
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
23
  none: false
26
- requirements:
24
+ requirements:
27
25
  - - ~>
28
- - !ruby/object:Gem::Version
26
+ - !ruby/object:Gem::Version
27
+ hash: 31
28
+ segments:
29
+ - 3
30
+ - 2
31
+ - 8
29
32
  version: 3.2.8
30
- - !ruby/object:Gem::Dependency
31
- name: sqlite3
32
- requirement: !ruby/object:Gem::Requirement
33
- none: false
34
- requirements:
35
- - - ! '>='
36
- - !ruby/object:Gem::Version
37
- version: '0'
38
- type: :development
39
33
  prerelease: false
40
- version_requirements: !ruby/object:Gem::Requirement
34
+ requirement: *id001
35
+ name: rails
36
+ - !ruby/object:Gem::Dependency
37
+ type: :development
38
+ version_requirements: &id002 !ruby/object:Gem::Requirement
41
39
  none: false
42
- requirements:
43
- - - ! '>='
44
- - !ruby/object:Gem::Version
45
- version: '0'
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ hash: 3
44
+ segments:
45
+ - 0
46
+ version: "0"
47
+ prerelease: false
48
+ requirement: *id002
49
+ name: sqlite3
46
50
  description: Description of Liking.
47
- email:
51
+ email:
48
52
  - wuweixin@gmail.com
49
53
  executables: []
54
+
50
55
  extensions: []
56
+
51
57
  extra_rdoc_files: []
52
- files:
53
- - app/assets/javascripts/liking/application.js
58
+
59
+ files:
54
60
  - app/assets/javascripts/liking/likes.js
61
+ - app/assets/javascripts/liking/application.js
55
62
  - app/assets/stylesheets/liking/application.css
56
63
  - app/assets/stylesheets/liking/likes.css
57
64
  - app/controllers/liking/application_controller.rb
58
65
  - app/controllers/liking/likes_controller.rb
59
- - app/helpers/liking/application_helper.rb
60
66
  - app/helpers/liking/likes_helper.rb
61
- - app/models/liking/like.rb
67
+ - app/helpers/liking/application_helper.rb
62
68
  - app/views/layouts/liking/application.html.erb
69
+ - app/models/liking/like.rb
70
+ - config/locales/en.yml
63
71
  - config/routes.rb
64
72
  - db/migrate/20120825063302_create_liking_likes.rb
65
- - lib/liking/engine.rb
66
- - lib/liking/version.rb
67
73
  - lib/liking.rb
68
74
  - lib/tasks/liking_tasks.rake
75
+ - lib/liking/version.rb
76
+ - lib/liking/engine.rb
69
77
  - MIT-LICENSE
70
78
  - Rakefile
71
79
  - README.rdoc
80
+ - test/test_helper.rb
81
+ - test/integration/navigation_test.rb
82
+ - test/dummy/script/rails
83
+ - test/dummy/public/422.html
84
+ - test/dummy/public/favicon.ico
85
+ - test/dummy/public/500.html
86
+ - test/dummy/public/404.html
87
+ - test/dummy/Rakefile
72
88
  - test/dummy/app/assets/javascripts/application.js
73
89
  - test/dummy/app/assets/stylesheets/application.css
74
90
  - test/dummy/app/controllers/application_controller.rb
75
91
  - test/dummy/app/helpers/application_helper.rb
76
92
  - test/dummy/app/views/layouts/application.html.erb
93
+ - test/dummy/README.rdoc
77
94
  - test/dummy/config/application.rb
78
- - test/dummy/config/boot.rb
79
95
  - test/dummy/config/database.yml
80
- - test/dummy/config/environment.rb
96
+ - test/dummy/config/environments/test.rb
81
97
  - test/dummy/config/environments/development.rb
82
98
  - test/dummy/config/environments/production.rb
83
- - test/dummy/config/environments/test.rb
84
- - test/dummy/config/initializers/backtrace_silencers.rb
99
+ - test/dummy/config/locales/en.yml
85
100
  - test/dummy/config/initializers/inflections.rb
86
- - test/dummy/config/initializers/mime_types.rb
87
101
  - test/dummy/config/initializers/secret_token.rb
88
- - test/dummy/config/initializers/session_store.rb
102
+ - test/dummy/config/initializers/backtrace_silencers.rb
89
103
  - test/dummy/config/initializers/wrap_parameters.rb
90
- - test/dummy/config/locales/en.yml
104
+ - test/dummy/config/initializers/mime_types.rb
105
+ - test/dummy/config/initializers/session_store.rb
91
106
  - test/dummy/config/routes.rb
107
+ - test/dummy/config/environment.rb
108
+ - test/dummy/config/boot.rb
92
109
  - test/dummy/config.ru
93
- - test/dummy/public/404.html
94
- - test/dummy/public/422.html
95
- - test/dummy/public/500.html
96
- - test/dummy/public/favicon.ico
97
- - test/dummy/Rakefile
98
- - test/dummy/README.rdoc
99
- - test/dummy/script/rails
100
- - test/fixtures/liking/likes.yml
101
110
  - test/functional/liking/likes_controller_test.rb
102
- - test/integration/navigation_test.rb
103
- - test/liking_test.rb
104
- - test/test_helper.rb
105
- - test/unit/helpers/liking/likes_helper_test.rb
106
111
  - test/unit/liking/like_test.rb
112
+ - test/unit/helpers/liking/likes_helper_test.rb
113
+ - test/liking_test.rb
114
+ - test/fixtures/liking/likes.yml
107
115
  homepage: http://github.com/wuwx/liking
108
116
  licenses: []
117
+
109
118
  post_install_message:
110
119
  rdoc_options: []
111
- require_paths:
120
+
121
+ require_paths:
112
122
  - lib
113
- required_ruby_version: !ruby/object:Gem::Requirement
123
+ required_ruby_version: !ruby/object:Gem::Requirement
114
124
  none: false
115
- requirements:
116
- - - ! '>='
117
- - !ruby/object:Gem::Version
118
- version: '0'
119
- segments:
125
+ requirements:
126
+ - - ">="
127
+ - !ruby/object:Gem::Version
128
+ hash: 3
129
+ segments:
120
130
  - 0
121
- hash: 2051035367951062154
122
- required_rubygems_version: !ruby/object:Gem::Requirement
131
+ version: "0"
132
+ required_rubygems_version: !ruby/object:Gem::Requirement
123
133
  none: false
124
- requirements:
125
- - - ! '>='
126
- - !ruby/object:Gem::Version
127
- version: '0'
128
- segments:
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ hash: 3
138
+ segments:
129
139
  - 0
130
- hash: 2051035367951062154
140
+ version: "0"
131
141
  requirements: []
142
+
132
143
  rubyforge_project:
133
- rubygems_version: 1.8.24
144
+ rubygems_version: 1.8.17
134
145
  signing_key:
135
146
  specification_version: 3
136
147
  summary: Summary of Liking.
137
- test_files:
148
+ test_files:
149
+ - test/test_helper.rb
150
+ - test/integration/navigation_test.rb
151
+ - test/dummy/script/rails
152
+ - test/dummy/public/422.html
153
+ - test/dummy/public/favicon.ico
154
+ - test/dummy/public/500.html
155
+ - test/dummy/public/404.html
156
+ - test/dummy/Rakefile
138
157
  - test/dummy/app/assets/javascripts/application.js
139
158
  - test/dummy/app/assets/stylesheets/application.css
140
159
  - test/dummy/app/controllers/application_controller.rb
141
160
  - test/dummy/app/helpers/application_helper.rb
142
161
  - test/dummy/app/views/layouts/application.html.erb
162
+ - test/dummy/README.rdoc
143
163
  - test/dummy/config/application.rb
144
- - test/dummy/config/boot.rb
145
164
  - test/dummy/config/database.yml
146
- - test/dummy/config/environment.rb
165
+ - test/dummy/config/environments/test.rb
147
166
  - test/dummy/config/environments/development.rb
148
167
  - test/dummy/config/environments/production.rb
149
- - test/dummy/config/environments/test.rb
150
- - test/dummy/config/initializers/backtrace_silencers.rb
168
+ - test/dummy/config/locales/en.yml
151
169
  - test/dummy/config/initializers/inflections.rb
152
- - test/dummy/config/initializers/mime_types.rb
153
170
  - test/dummy/config/initializers/secret_token.rb
154
- - test/dummy/config/initializers/session_store.rb
171
+ - test/dummy/config/initializers/backtrace_silencers.rb
155
172
  - test/dummy/config/initializers/wrap_parameters.rb
156
- - test/dummy/config/locales/en.yml
173
+ - test/dummy/config/initializers/mime_types.rb
174
+ - test/dummy/config/initializers/session_store.rb
157
175
  - test/dummy/config/routes.rb
176
+ - test/dummy/config/environment.rb
177
+ - test/dummy/config/boot.rb
158
178
  - test/dummy/config.ru
159
- - test/dummy/public/404.html
160
- - test/dummy/public/422.html
161
- - test/dummy/public/500.html
162
- - test/dummy/public/favicon.ico
163
- - test/dummy/Rakefile
164
- - test/dummy/README.rdoc
165
- - test/dummy/script/rails
166
- - test/fixtures/liking/likes.yml
167
179
  - test/functional/liking/likes_controller_test.rb
168
- - test/integration/navigation_test.rb
169
- - test/liking_test.rb
170
- - test/test_helper.rb
171
- - test/unit/helpers/liking/likes_helper_test.rb
172
180
  - test/unit/liking/like_test.rb
181
+ - test/unit/helpers/liking/likes_helper_test.rb
182
+ - test/liking_test.rb
183
+ - test/fixtures/liking/likes.yml