fi_seo 0.1.0 → 0.1.5

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
  SHA256:
3
- metadata.gz: a4b6862bad29b1fb7ce90cab401d565ee92516c9ace05e8ebb9936e317549506
4
- data.tar.gz: 82faae7924d91bbf8e63071fb6b75e3dd0403c3ac854df138eb374a635de7bbf
3
+ metadata.gz: dafe48f7fa03b31b7de1446395510a5699c8842a9635ad72c465dc115e89dd0a
4
+ data.tar.gz: 192b67cb704a702be128d618cf36705c16284dd3c103ba073f9cf7df0db1eaa2
5
5
  SHA512:
6
- metadata.gz: a239940436fe911a43d9e90fdbe740ae0799bd5b5e242e88af7c931e6872ae9d87ae085913d11003e69704ab666810a262b92afbb5e4ea599066ae2a93d62a64
7
- data.tar.gz: 277b06536793f9f15cb35cae8ad76ce162596c852e834459f6be49ffa9a552fd0ca39caf8b1bc75d522678266c3919bb87f073dd81bb1eedbf345a8eea933836
6
+ metadata.gz: f4712349ec325ab202855b96aa2cbd479067de2bf61b5778047bfa299f5b2ac1c48037e373d1eb6f3f1e836e82a283444ea0d98ea8d2d95cadd932eef5b4384a
7
+ data.tar.gz: 7195f54ef2f2a67f4abf05813fb82653d13765f1f46dd8ac0d808bf7dd8a0f03437464c526219fd46f7e1a36fcef20cc5d7bc7bd3ed11d0ca222085ff381a43c
data/Gemfile CHANGED
@@ -6,5 +6,5 @@ gemspec
6
6
  gem 'rake', '~> 12.0'
7
7
  gem 'rspec', '~> 3.0'
8
8
  gem 'meta-tags', '~> 2.13'
9
- gem 'activerecord','~> 5.0', '>= 5.0.0.1'
9
+ gem 'activerecord', '>= 5.0', '< 6.1'
10
10
  gem 'xml-sitemap', '~> 1.3', '>= 1.3.3'
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fi_seo (0.1.0)
5
- activerecord (~> 5.0, >= 5.0.0.1)
4
+ fi_seo (0.1.4)
5
+ activerecord (>= 5.0, < 6.1)
6
6
  meta-tags (~> 2.13)
7
7
  xml-sitemap (~> 1.3, >= 1.3.3)
8
8
 
@@ -82,7 +82,7 @@ PLATFORMS
82
82
  ruby
83
83
 
84
84
  DEPENDENCIES
85
- activerecord (~> 5.0, >= 5.0.0.1)
85
+ activerecord (>= 5.0, < 6.1)
86
86
  fi_seo!
87
87
  meta-tags (~> 2.13)
88
88
  rake (~> 12.0)
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 TODO: Write your name
3
+ Copyright (c) 2020 Fidenz
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # FiSeo
2
2
 
3
- This gem provides a easier solution to search engine optimization(SEO) in a ruby project. This will give you the seo capabilities to your static pages and dynamic pages alike with few lines of code.
3
+ This gem provides a easier solution to search engine optimization(SEO) in a rails project. This will give you the seo capabilities to your static pages and dynamic pages alike with few lines of code.
4
4
  Also site maps are essential to the SEO of your web application. So this gem gives that capabilities with a feature to integrate google analytics.
5
5
 
6
6
  This gem currently integrate with the Active Admin for management of the gem. Dynamic pages and other settings also include with the integration.
@@ -33,7 +33,7 @@ And then execute:
33
33
 
34
34
  After updating your bundle, run the migration as follows:
35
35
 
36
- $ acts_as_seoable:migrate
36
+ $ rails g acts_as_seoable:migrate
37
37
  $ rails db:migrate
38
38
 
39
39
  ## Usage
@@ -125,7 +125,7 @@ If the model has attributes for that you need to use for the seoable attributes
125
125
  acts_as_seoable :title_seoable, :description, :keywords
126
126
 
127
127
  def title_seoable
128
- "#{self.name}#{self.id}"
128
+ "#{self.name}#{self.id}"
129
129
  end
130
130
  ```
131
131
  when you create a new record from this model the gem will create a corresponding seoable record as well. Above values will be set as default values.
@@ -171,6 +171,23 @@ def twitter_tags
171
171
  end
172
172
  ```
173
173
 
174
+ For adding dynamic tags to frontend please add meta tags as follows:
175
+
176
+ ```ruby
177
+ # some_controller.rb
178
+
179
+ def show
180
+ @user = User.find(params[:id])
181
+ set_meta_tags @user
182
+ end
183
+ ```
184
+
185
+ For adding dynamic meta tags for existing records please run following:
186
+
187
+ ```ruby
188
+ Model.find_each(&:save)
189
+ ```
190
+
174
191
  ### Sitemap
175
192
 
176
193
  For sitemap you need to configure as follows:
@@ -206,20 +223,20 @@ There are few initializers and generators for this gem to help you to configure
206
223
 
207
224
  Before using the gem you need to migrate the tables for gem to databalse. To get the migration run the following code:
208
225
  ```bash
209
- $ acts_as_seoable:migrate
226
+ $ rails g acts_as_seoable:migrate
210
227
  ```
211
228
  #### Gem Initializer
212
229
  This initializer will give ability to set few social configuration and website name for seo and few other things.
213
230
  Run the following code for to create initializer:
214
231
  ```bash
215
- $ acts_as_seoable:install
232
+ $ rails g acts_as_seoable:install
216
233
  ```
217
234
  #### Active Admin Page
218
235
  *Only if you are using active admin*
219
236
 
220
237
  To add SEO data to active admin you need to run following code. This will generate a admin page:
221
238
  ```bash
222
- $ acts_as_seoable:admin
239
+ $ rails g acts_as_seoable:admin
223
240
  ```
224
241
 
225
242
  #### Active Admin View Helper
@@ -227,7 +244,7 @@ $ acts_as_seoable:admin
227
244
 
228
245
  To add active admin view helper you need to run following code. This will generate a **arb** file to add dynamic pages show and edit action:
229
246
  ```bash
230
- $ acts_as_seoable:admin_view_helper
247
+ $ rails g acts_as_seoable:admin_view_helper
231
248
  ```
232
249
 
233
250
  ### Active Admin
@@ -297,7 +314,7 @@ Got a bug and you're not sure? You're sure you have a bug, but don't know what t
297
314
 
298
315
  ## Contributing
299
316
 
300
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/fi_seo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/fi_seo/blob/master/CODE_OF_CONDUCT.md).
317
+ Bug reports and pull requests are welcome on GitHub at https://github.com/Fidenz/fi_seo. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/Fidenz/fi_seo/blob/master/CODE_OF_CONDUCT.md).
301
318
 
302
319
 
303
320
  ## License
@@ -306,4 +323,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
306
323
 
307
324
  ## Code of Conduct
308
325
 
309
- Everyone interacting in the FiSeo project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/fi_seo/blob/master/CODE_OF_CONDUCT.md).
326
+ Everyone interacting in the FiSeo project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/Fidenz/fi_seo/blob/master/CODE_OF_CONDUCT.md).
@@ -3,13 +3,13 @@ require_relative 'lib/acts_as_seoable/version'
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'fi_seo'
5
5
  spec.version = FiSeo::VERSION
6
- spec.authors = ['Banura Randika']
7
- spec.email = ['info@fidenz.com', 'tech@fidenz.com', 'banura.r@fidenz.com']
6
+ spec.authors = ['Fidenz']
7
+ spec.email = ['info@fidenz.com']
8
8
 
9
9
  spec.summary = 'Flexible SEO solution for rails projects'
10
- spec.description = 'This gem provides a easier solution to search engine optimization(SEO) in a ruby project. This will give you the seo capabilities to your static pages anddynamic pages alike with few lines of code.
10
+ spec.description = 'This gem provides a easier solution to search engine optimization(SEO) in a rails project. This will give you the seo capabilities to your static pages and dynamic pages alike with few lines of code.
11
11
  Also site maps are essential to the SEO of your web application. So this gem gives that capabilities with a feature to integrate google analytics.'
12
- spec.homepage = 'https://github.com/fidenz-developer/fi-seo.git'
12
+ spec.homepage = 'https://github.com/Fidenz/fi_seo'
13
13
  spec.license = 'MIT'
14
14
  spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
15
15
 
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
24
  spec.require_paths = ['lib']
25
25
 
26
- spec.add_runtime_dependency 'activerecord', '~> 5.0', '>= 5.0.0.1'
27
- spec.add_runtime_dependency('meta-tags', '~> 2.13')
26
+ spec.add_runtime_dependency 'activerecord', '>= 5.0', '< 6.1'
27
+ spec.add_runtime_dependency 'meta-tags', '~> 2.13'
28
28
  spec.add_runtime_dependency 'xml-sitemap', '~> 1.3', '>= 1.3.3'
29
29
  end
@@ -1,3 +1,3 @@
1
1
  module FiSeo
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -159,7 +159,7 @@ module FiSeo
159
159
  self.create_dynamic_seo_record
160
160
  else
161
161
  DynamicSeo.where(seoable_type: self.class.to_s).where(seoable_id: self.id)
162
- .update_all(title: self.title_value, description: self.description_value, keywords: self.keywords_value)
162
+ .update_all(title: self.dynamic_seo.title, description: self.dynamic_seo.description, keywords: self.dynamic_seo.keywords)
163
163
  end
164
164
  end
165
165
  end
@@ -14,8 +14,26 @@ module ActsAsSeoable
14
14
  end
15
15
 
16
16
  def copy_migrations
17
- migration_template 'migration.rb',
18
- 'db/migrate/create_seo_tables.rb'
17
+ migration_template 'migration.erb',
18
+ 'db/migrate/create_seo_tables.rb', migration_version: migration_version
19
+ end
20
+
21
+ private
22
+
23
+ def migration_version
24
+ if rails5?
25
+ '[4.2]'
26
+ elsif rails6?
27
+ '[6.0]'
28
+ end
29
+ end
30
+
31
+ def rails5?
32
+ Rails.version.start_with? '5'
33
+ end
34
+
35
+ def rails6?
36
+ Rails.version.start_with? '6'
19
37
  end
20
38
  end
21
39
  end
@@ -1,4 +1,4 @@
1
- class CreateSeoTables < ActiveRecord::Migration[5.2]
1
+ class CreateSeoTables < ActiveRecord::Migration<%= migration_version %>
2
2
  def self.up
3
3
  create_table :dynamic_seos do |t|
4
4
  t.string :seoable_type, null: false
metadata CHANGED
@@ -1,35 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fi_seo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
- - Banura Randika
7
+ - Fidenz
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2020-09-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '5.0'
20
- - - ">="
20
+ - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 5.0.0.1
22
+ version: '6.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: '5.0'
30
- - - ">="
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 5.0.0.1
32
+ version: '6.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: meta-tags
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -65,12 +65,10 @@ dependencies:
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.3.3
67
67
  description: |-
68
- This gem provides a easier solution to search engine optimization(SEO) in a ruby project. This will give you the seo capabilities to your static pages anddynamic pages alike with few lines of code.
68
+ This gem provides a easier solution to search engine optimization(SEO) in a rails project. This will give you the seo capabilities to your static pages and dynamic pages alike with few lines of code.
69
69
  Also site maps are essential to the SEO of your web application. So this gem gives that capabilities with a feature to integrate google analytics.
70
70
  email:
71
71
  - info@fidenz.com
72
- - tech@fidenz.com
73
- - banura.r@fidenz.com
74
72
  executables: []
75
73
  extensions: []
76
74
  extra_rdoc_files: []
@@ -109,12 +107,12 @@ files:
109
107
  - lib/generators/acts_as_seoable/install/install_generator.rb
110
108
  - lib/generators/acts_as_seoable/install/templates/initializer.rb
111
109
  - lib/generators/acts_as_seoable/migrate/migrate_generator.rb
112
- - lib/generators/acts_as_seoable/migrate/templates/migration.rb
110
+ - lib/generators/acts_as_seoable/migrate/templates/migration.erb
113
111
  - screenshots/dynamic-pages-seoable.png
114
112
  - screenshots/static-pages-seoable-details.png
115
113
  - screenshots/static-pages-seoable-frontend.png
116
114
  - screenshots/static-pages-seoable.png
117
- homepage: https://github.com/fidenz-developer/fi-seo.git
115
+ homepage: https://github.com/Fidenz/fi_seo
118
116
  licenses:
119
117
  - MIT
120
118
  metadata: {}