phrasing 4.0.0 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +12 -0
  3. data/MIT-LICENSE +0 -0
  4. data/README.md +5 -5
  5. data/Rakefile +0 -0
  6. data/app/assets/fonts/icomoon.dev.svg +0 -0
  7. data/app/assets/fonts/icomoon.eot +0 -0
  8. data/app/assets/fonts/icomoon.svg +0 -0
  9. data/app/assets/fonts/icomoon.ttf +0 -0
  10. data/app/assets/fonts/icomoon.woff +0 -0
  11. data/app/assets/images/phrasing_icon_edit_all.png +0 -0
  12. data/app/assets/javascripts/phrasing_engine.js +0 -0
  13. data/app/assets/stylesheets/phrasing_engine.css +0 -0
  14. data/app/models/phrasing_phrase.rb +1 -1
  15. data/app/models/phrasing_phrase_version.rb +0 -0
  16. data/app/views/layouts/phrasing.html.haml +0 -0
  17. data/app/views/phrasing/_initializer.html.haml +0 -0
  18. data/app/views/phrasing/_menu.html.haml +0 -0
  19. data/app/views/phrasing/_messages.html.haml +0 -0
  20. data/app/views/phrasing_phrases/edit.html.haml +0 -0
  21. data/app/views/phrasing_phrases/help.html.haml +0 -0
  22. data/lib/generators/phrasing/phrasing_generator.rb +11 -1
  23. data/lib/generators/phrasing/templates/db/migrate/create_phrasing_phrase_versions.rb +2 -2
  24. data/lib/generators/phrasing/templates/db/migrate/create_phrasing_phrases.rb +2 -2
  25. data/lib/phrasing/version.rb +1 -1
  26. data/spec/dummy/Rakefile +0 -0
  27. data/spec/dummy/app/controllers/application_controller.rb +0 -0
  28. data/spec/dummy/app/helpers/application_helper.rb +0 -0
  29. data/spec/dummy/app/helpers/phrasing_helper.rb +0 -0
  30. data/spec/dummy/app/models/.gitkeep +0 -0
  31. data/spec/dummy/app/views/layouts/application.html.erb +0 -0
  32. data/spec/dummy/config.ru +0 -0
  33. data/spec/dummy/config/application.rb +0 -0
  34. data/spec/dummy/config/boot.rb +0 -0
  35. data/spec/dummy/config/database.yml +0 -0
  36. data/spec/dummy/config/environment.rb +0 -0
  37. data/spec/dummy/config/environments/development.rb +0 -0
  38. data/spec/dummy/config/environments/production.rb +0 -0
  39. data/spec/dummy/config/environments/test.rb +0 -0
  40. data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -0
  41. data/spec/dummy/config/initializers/inflections.rb +0 -0
  42. data/spec/dummy/config/initializers/phrasing.rb +0 -0
  43. data/spec/dummy/config/initializers/secret_token.rb +0 -0
  44. data/spec/dummy/config/initializers/session_store.rb +0 -0
  45. data/spec/dummy/config/initializers/wrap_parameters.rb +0 -0
  46. data/spec/dummy/config/locales/en.yml +0 -0
  47. data/spec/dummy/db/.gitkeep +0 -0
  48. data/spec/dummy/db/migrate/20131120000855_create_phrasing_phrases.phrasing_rails_engine.rb +0 -0
  49. data/spec/dummy/db/migrate/20131120000856_create_phrasing_phrase_versions.phrasing_rails_engine.rb +0 -0
  50. data/spec/dummy/public/404.html +0 -0
  51. data/spec/dummy/public/422.html +0 -0
  52. data/spec/dummy/public/500.html +0 -0
  53. data/spec/dummy/public/favicon.ico +0 -0
  54. data/spec/factories/phrasing_phrases.rb +0 -0
  55. data/spec/models/phrasing_phrase_spec.rb +0 -0
  56. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ac71c985745a5d8d7ee591a4961f984c93c38e6e
4
- data.tar.gz: c08b20fe85f8d0f79c065a686c4781ff4d18bfac
3
+ metadata.gz: 55d147e3e48d972d348630d456c2d586f67f9774
4
+ data.tar.gz: ceae3db8c6045a2c94fbf3ffd44e3fc9ac9fee54
5
5
  SHA512:
6
- metadata.gz: 814529d02b1759ae377698ec1377c53bc503933d6c43bb5bc664482eb0ec36ac9566f5642eba588e6ee233d93934895bfac35cfe6dd115838a04c6667a8925e4
7
- data.tar.gz: 94f4bec1be3674a20c13960805845c7b4cdc9e9d1f6f4199f8afedbde1b0807bb23510fd25d33f1292d11d0b0e5e612c4cdcf91928ab8adf4a2b2ef343ba5f7a
6
+ metadata.gz: 2813efc6bec82a7490c6e97f16699b61180d8b94dc86b54a6603e9ea5e36079318ec7ac28202698ab3f6ab175e98184491a99203c687dcc225f29f9db8390f10
7
+ data.tar.gz: 16c4d3e4e752301beadfd28ae79d7ea4adfde5d3ae4cd405801a113096408f468cadf3689f9d87ae18a51ee292a7b48d142a479fc5a5cca198cf1b52dbb53fe9
@@ -1,5 +1,17 @@
1
1
  # Phrasing Change Log
2
2
 
3
+ ## 4.1.0 (May 17th, 2018)
4
+
5
+ Fix generated migration files for Rails 5
6
+ ```
7
+ Directly inheriting from ActiveRecord::Migration is not supported. Please specify the Rails release the migration was written for.
8
+ ```
9
+
10
+ Fixed Rails 5.2 deprecation issue with `class_name`:
11
+ ```
12
+ A class was passed to :class_name but we are expecting a string.
13
+ ```
14
+
3
15
  ## 4.0.0 (February 27th, 2018)
4
16
 
5
17
  ### Separation of I18n and Phrasing:
File without changes
data/README.md CHANGED
@@ -42,10 +42,10 @@ module PhrasingHelper
42
42
  end
43
43
  end
44
44
  ```
45
- Include the phrasing **html** initializer at the top of your application layout file.
45
+ Include the phrasing **html** initializer right below the `<body>` tag in your application layout file.
46
46
 
47
- ```haml
48
- = render 'phrasing/initializer'
47
+ ```
48
+ <%= render 'phrasing/initializer' %>
49
49
  ```
50
50
 
51
51
  Include the required **javascript** files:
@@ -72,11 +72,11 @@ Include the required **stylesheet** file:
72
72
 
73
73
  You can start adding new phrases by simply adding them in your view file:
74
74
 
75
- = phrase('my-first-phrase')
75
+ <%= phrase('my-first-phrase') %>
76
76
 
77
77
  Aside from editing phrases (basically, Rails translations) you can also edit model attributes inline. Use the same `phrase` method, with the first attribute being the record in question, and the second one the attribute you wish to make editable:
78
78
 
79
- = phrase(@post, :title)
79
+ <%= phrase(@post, :title) %>
80
80
 
81
81
  In the above example, <tt>@post</tt> is the record with a <tt>title</tt> attribute.
82
82
 
data/Rakefile CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -4,7 +4,7 @@ class PhrasingPhrase < ActiveRecord::Base
4
4
  # validate :uniqueness_of_key_on_locale_scope, on: :create
5
5
  validates_uniqueness_of :key, scope: [:locale]
6
6
 
7
- has_many :versions, dependent: :destroy, class_name: PhrasingPhraseVersion
7
+ has_many :versions, dependent: :destroy, class_name: 'PhrasingPhraseVersion'
8
8
 
9
9
  after_update :version_it
10
10
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -23,4 +23,14 @@ class PhrasingGenerator < Rails::Generators::Base
23
23
  sleep 1 # migration numbers should differentiate
24
24
  Time.now.utc.strftime("%Y%m%d%H%M%S")
25
25
  end
26
- end
26
+
27
+ def migration_version
28
+ if rails5?
29
+ "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]"
30
+ end
31
+ end
32
+
33
+ def rails5?
34
+ Rails.version.start_with? '5'
35
+ end
36
+ end
@@ -1,4 +1,4 @@
1
- class CreatePhrasingPhraseVersions < ActiveRecord::Migration
1
+ class CreatePhrasingPhraseVersions < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :phrasing_phrase_versions do |t|
4
4
  t.integer :phrasing_phrase_id
@@ -7,4 +7,4 @@ class CreatePhrasingPhraseVersions < ActiveRecord::Migration
7
7
  end
8
8
  add_index :phrasing_phrase_versions, :phrasing_phrase_id
9
9
  end
10
- end
10
+ end
@@ -1,4 +1,4 @@
1
- class CreatePhrasingPhrases < ActiveRecord::Migration
1
+ class CreatePhrasingPhrases < ActiveRecord::Migration<%= migration_version %>
2
2
  def change
3
3
  create_table :phrasing_phrases do |t|
4
4
  t.string :locale
@@ -7,4 +7,4 @@ class CreatePhrasingPhrases < ActiveRecord::Migration
7
7
  t.timestamps
8
8
  end
9
9
  end
10
- end
10
+ end
@@ -1,3 +1,3 @@
1
1
  module Phrasing
2
- VERSION = '4.0.0'.freeze
2
+ VERSION = '4.1.0'.freeze
3
3
  end
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phrasing
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomislav Car
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-02-28 00:00:00.000000000 Z
12
+ date: 2018-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -200,7 +200,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
200
200
  version: '0'
201
201
  requirements: []
202
202
  rubyforge_project:
203
- rubygems_version: 2.4.5
203
+ rubygems_version: 2.6.11
204
204
  signing_key:
205
205
  specification_version: 4
206
206
  summary: Edit phrases inline for Rails applications!