webnames 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/generators/webnames/install/install_generator.rb +4 -0
- data/lib/generators/webnames/install/templates/webnames_initializer.rb +5 -0
- data/lib/webnames/rails/active_record.rb +4 -2
- data/lib/webnames/rails/routes.rb +4 -2
- data/lib/webnames/version.rb +1 -1
- data/lib/webnames.rb +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 431989b46773f8aca9bacdd12d322c6c0366b6e8
|
4
|
+
data.tar.gz: c6b62052a5261b11c20b63ef803aca1b14150615
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c18bdb74168118bcfca1568bd2709905e2ebe139275ac37d94593d0e6c8b49a0b37269a38905f59243fd6e5fc1b32ebe908b17d8a4ef6f2108966708542b3cf6
|
7
|
+
data.tar.gz: 28059e39ebb0392da62cf44882a61519bd61cbd9c2f3e2cf21b5fe1130d9bc1b7852950973924f4ecc74252d102dcc9cef5d3b2c5133cad3242fd81470022bcf
|
@@ -6,6 +6,10 @@ class Webnames::InstallGenerator < ActiveRecord::Generators::Base
|
|
6
6
|
|
7
7
|
argument :name, :type => :string, :default => "Webname", :banner => "Webname"
|
8
8
|
|
9
|
+
def copy_initialize_file
|
10
|
+
copy_file "webnames_initializer.rb", "config/initializers/webnames.rb"
|
11
|
+
end
|
12
|
+
|
9
13
|
def generate_model
|
10
14
|
copy_file "webnames-active_record.rb", model_path
|
11
15
|
end
|
@@ -11,8 +11,10 @@ module Webnames
|
|
11
11
|
extend ActiveSupport::Concern
|
12
12
|
|
13
13
|
included do
|
14
|
-
has_one :
|
15
|
-
default_scope -> { includes(:
|
14
|
+
has_one :webname_model, class_name: 'Webname', as: :resource
|
15
|
+
default_scope -> { includes(:webname_model) }
|
16
|
+
|
17
|
+
delegate :webname, to: :webname_model
|
16
18
|
|
17
19
|
def to_param
|
18
20
|
self.webname
|
@@ -8,8 +8,10 @@ module ActionDispatch::Routing
|
|
8
8
|
options_with_blank_path = options.reverse_merge path: '', except: [:new, :create, :index]
|
9
9
|
options_with_path = options.reverse_merge except: [:show, :edit, :update, :destroy]
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
constraints webname: Webnames.regex do
|
12
|
+
resources resources_name, options_with_blank_path, &block
|
13
|
+
resources resources_name, options_with_path, &block
|
14
|
+
end
|
13
15
|
end
|
14
16
|
end
|
15
17
|
end
|
data/lib/webnames/version.rb
CHANGED
data/lib/webnames.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webnames
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sadjow Medeiros Leão
|
@@ -71,6 +71,7 @@ files:
|
|
71
71
|
- lib/generators/webnames/install/install_generator.rb
|
72
72
|
- lib/generators/webnames/install/templates/migration.rb
|
73
73
|
- lib/generators/webnames/install/templates/webnames-active_record.rb
|
74
|
+
- lib/generators/webnames/install/templates/webnames_initializer.rb
|
74
75
|
- lib/tasks/webnames_tasks.rake
|
75
76
|
- lib/webnames.rb
|
76
77
|
- lib/webnames/engine.rb
|
@@ -78,7 +79,8 @@ files:
|
|
78
79
|
- lib/webnames/rails/routes.rb
|
79
80
|
- lib/webnames/version.rb
|
80
81
|
homepage: https://github.com/sadjow/webnames
|
81
|
-
licenses:
|
82
|
+
licenses:
|
83
|
+
- MIT
|
82
84
|
metadata: {}
|
83
85
|
post_install_message:
|
84
86
|
rdoc_options: []
|