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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 157fa170a3ddb38634e14e1c35a31ad9916f6032
4
- data.tar.gz: ff272e01f812300fbe253ffae87623e2c80acf64
3
+ metadata.gz: 254863473a8ee60a4549a9e7e44482bf7370da84
4
+ data.tar.gz: 221aba9e95cf6a7c91f1e9d712ee2b2083185b6a
5
5
  SHA512:
6
- metadata.gz: 87dad900984413e5480680800baaeaae3fc9b50104190713f0dca1f20537a18d04cb1d137db9011303248e91a7d707c1fe64b12be7065b18900e3c368da0ca4b
7
- data.tar.gz: 14131fa9081ef9cb5a96f171067ace1c0a6e83dd9b9e2c898318915cffc7e8076c4147b9d0a676e3f85b97801ce017c47c8b7d1acc6663a89eeb4ae666606a30
6
+ metadata.gz: 5fe5fca9a2d818248a85707325cdece8f16d004b0ebccc28d20d03b38cb8556be162c1446453d8f67c8a123645aa8feafa719fecee08ea9bdce581a7da52c56e
7
+ data.tar.gz: 5cea7118798956cc13de8f57ae032b400cd9fca1e35f12192b3e180047c3eae02d560125c444fd4abdbc84a5364e313f9859307c7c3f957a08ea3762a6d21bc2
data/.gitignore CHANGED
@@ -12,3 +12,4 @@
12
12
  *.o
13
13
  *.a
14
14
  mkmf.log
15
+ *.gem
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RudslRails
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
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
@@ -22,4 +22,5 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake", "~> 10.0"
23
23
 
24
24
  spec.add_runtime_dependency "rails", ">= 4.0"
25
+ spec.add_runtime_dependency "rudsl", ">= 1.0"
25
26
  end
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.0.0
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