rudsl_rails 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/generators/rudsl_card_generator.rb +22 -0
- data/lib/rudsl_rails/version.rb +1 -1
- data/lib/rudsl_rails.rb +9 -3
- data/rudsl_rails.gemspec +1 -0
- metadata +16 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 254863473a8ee60a4549a9e7e44482bf7370da84
|
4
|
+
data.tar.gz: 221aba9e95cf6a7c91f1e9d712ee2b2083185b6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5fe5fca9a2d818248a85707325cdece8f16d004b0ebccc28d20d03b38cb8556be162c1446453d8f67c8a123645aa8feafa719fecee08ea9bdce581a7da52c56e
|
7
|
+
data.tar.gz: 5cea7118798956cc13de8f57ae032b400cd9fca1e35f12192b3e180047c3eae02d560125c444fd4abdbc84a5364e313f9859307c7c3f957a08ea3762a6d21bc2
|
data/.gitignore
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
class RudslCardGenerator < Rails::Generators::NamedBase
|
2
|
+
def create_helper_file
|
3
|
+
create_file "app/cards/#{class_name.split("::").map(&:underscore).join("/")}_card.rb", <<-FILE
|
4
|
+
class #{class_name}Card < RudslRails::Card
|
5
|
+
# TODO: Example arguments
|
6
|
+
#attr_reader :arg
|
7
|
+
|
8
|
+
# TODO: Example constructor for saving relevant objects
|
9
|
+
#def initialize(arg)
|
10
|
+
# @arg = arg
|
11
|
+
#end
|
12
|
+
|
13
|
+
# TODO: The 'node' method is where the DOM should be created.
|
14
|
+
def node
|
15
|
+
#div do
|
16
|
+
# h1 @arg.to_s
|
17
|
+
#end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
FILE
|
21
|
+
end
|
22
|
+
end
|
data/lib/rudsl_rails/version.rb
CHANGED
data/lib/rudsl_rails.rb
CHANGED
@@ -2,10 +2,7 @@ require "rudsl_rails/version"
|
|
2
2
|
|
3
3
|
module RudslRails
|
4
4
|
class Card
|
5
|
-
include Rails.application.routes.url_helpers
|
6
5
|
include Rudsl
|
7
|
-
include UsersHelper
|
8
|
-
include ApplicationHelper
|
9
6
|
include ActionView::Helpers::AssetUrlHelper
|
10
7
|
include ActionView::Helpers::AssetTagHelper
|
11
8
|
include ERB::Util
|
@@ -15,6 +12,14 @@ module RudslRails
|
|
15
12
|
include ActionView::Helpers::DateHelper
|
16
13
|
include ActionView::Helpers::TextHelper
|
17
14
|
|
15
|
+
def method_missing(method_sym, *arguments, &block)
|
16
|
+
if method_sym.to_s.end_with?("_path") || method_sym.to_s.end_with?("_url")
|
17
|
+
Rails.application.routes.url_helpers.send(method_sym, arguments, &block)
|
18
|
+
else
|
19
|
+
super
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
18
23
|
def node
|
19
24
|
# implement node here
|
20
25
|
end
|
@@ -27,6 +32,7 @@ module RudslRails
|
|
27
32
|
view = ActionView::Base.new(Rails.configuration.paths['app/views'])
|
28
33
|
view.class_eval do
|
29
34
|
include Rails.application.routes.url_helpers
|
35
|
+
include ApplicationHelper
|
30
36
|
end
|
31
37
|
view.render args.first
|
32
38
|
end
|
data/rudsl_rails.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rudsl_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ajith Hussain
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '4.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rudsl
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '1.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.0'
|
55
69
|
description: rudsl_rails helps organise your Rails view written in rudsl
|
56
70
|
email:
|
57
71
|
- csy0013@googlemail.com
|
@@ -64,6 +78,7 @@ files:
|
|
64
78
|
- LICENSE.txt
|
65
79
|
- README.md
|
66
80
|
- Rakefile
|
81
|
+
- lib/generators/rudsl_card_generator.rb
|
67
82
|
- lib/rudsl_rails.rb
|
68
83
|
- lib/rudsl_rails/version.rb
|
69
84
|
- rudsl_rails.gemspec
|