inversion 0.16.0 → 0.17.1

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: a4433eb48f907f0b5861914eb3ec073bee86431b
4
- data.tar.gz: 99143eca9a86f27e54488b9cbb5f8aa9d2cf9072
3
+ metadata.gz: 43b08253199cda04327e19141aefe596941482be
4
+ data.tar.gz: 002f96158f9dbbe89ea1671c9d1abc827b80b55b
5
5
  SHA512:
6
- metadata.gz: e4a08815c33455449aaf698a30012673674f912f6c05a57f6ac91b17d91a81b7816f0402074a0fe3ba4633f1dc19953f601ebe3830866106555afa2695d72cdc
7
- data.tar.gz: 0cfbcfeab6c68c663c9e58c3832fe50a6ab803148d1c51dc7ba1cbcf821b01d3000164a1944086bf5f8ee241ea17db0e31209a7a1d12d8c8727e89e5b1ec27b5
6
+ metadata.gz: b2c1e583e7d92c0e18f47f977fd0ffb3948af841d2446dd1029026f9b7ad593c0ca36a235235a0f30ad2e26ee7bddb8b197a5490cabb4b79ba71eebc9f06b934
7
+ data.tar.gz: dd13d3317c1423bbd94c26bf2a031652981fa04536d98dad094354e10b6596428560246f2e24bb11e3e7e063d84412f405e37c37ac46018993d107f4aa0cd565
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1 @@
1
- ��QmXm�W�mN
1
+ ����(���r��0&�/Y��F\qgqObS7�Շ�?r6��j��Z ��˽h+F�`4?��8d'����P�⊌U�����ܼb�]����jF9�᫫���h�.8uJf �Ai��]t�P���y�s���|�#a�44�Im��&��E���W�ih�@�vǑʴ��%\�Z��f�E~��с:���ɡz��02U��'h�E[���QR\� ���Ё��*$�x���&��p-&]b�-
data/History.rdoc CHANGED
@@ -1,3 +1,13 @@
1
+ == v0.17.1 [2015-01-15] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ Re-push to fix a misbuilt gem.
4
+
5
+
6
+ == v0.17.0 [2015-01-15] Michael Granger <ged@FaerieMUD.org>
7
+
8
+ Support snakecase tag names/tag filenames
9
+
10
+
1
11
  == v0.16.0 [2015-01-14] Michael Granger <ged@FaerieMUD.org>
2
12
 
3
13
  Add support for loading templates from an alternate path
data/lib/inversion.rb CHANGED
@@ -26,10 +26,10 @@ module Inversion
26
26
  warn ">>> Inversion requires Ruby 2.0.0 or later. <<<" if RUBY_VERSION < '2.0.0'
27
27
 
28
28
  # Library version constant
29
- VERSION = '0.16.0'
29
+ VERSION = '0.17.1'
30
30
 
31
31
  # Version-control revision constant
32
- REVISION = %q$Revision: 83bef41f95a3 $
32
+ REVISION = %q$Revision: 0d5760c23bc9 $
33
33
 
34
34
 
35
35
  ### Get the Inversion version.
@@ -80,7 +80,7 @@ class Inversion::Template::Tag < Inversion::Template::Node
80
80
  # Inversion.log.debug " skipping abstract class %p" % [ derivclass ]
81
81
  nil
82
82
  else
83
- derivclass.name.downcase =~ /\b#{tagname}tag$/
83
+ derivclass.name.downcase =~ /\b#{tagname.gsub('_', '')}tag$/
84
84
  end
85
85
  end
86
86
 
@@ -90,7 +90,12 @@ class Inversion::Template::Tag < Inversion::Template::Node
90
90
  end
91
91
 
92
92
  Inversion.log.debug " found: %p" % [ tagclass ]
93
- tags[ tagname.to_sym ] = tagclass
93
+ snakecase_name = tagclass.name.sub( /^.*\b(\w+)Tag$/i, '\1' )
94
+ snakecase_name = snakecase_name.gsub( /([a-z])([A-Z])/, '\1_\2' ).downcase
95
+ Inversion.log.debug " mapping %p to names: %p" % [ tagclass, snakecase_name ]
96
+
97
+ tags[ snakecase_name.to_sym ] = tagclass
98
+ tags[ snakecase_name.gsub('_', '').to_sym ] = tagclass
94
99
  end
95
100
 
96
101
  @types ||= {}
@@ -31,7 +31,7 @@ describe Inversion::Template::Tag do
31
31
  expect( Inversion::Template::Tag ).to receive( :require ) do |filename|
32
32
  expect( filename ).to eq( 'inversion/template/zebratag' )
33
33
  Class.new( Inversion::Template::Tag ) do
34
- def self::name; "ZebraTag"; end
34
+ def self::name; "Inversion::Template::ZebraTag"; end
35
35
  end
36
36
  end
37
37
  result = Inversion::Template::Tag.load_all
@@ -51,7 +51,7 @@ describe Inversion::Template::Tag do
51
51
  expect( filename ).to eq( 'inversion/template/zebratag' )
52
52
  Class.new( Inversion::Template::Tag ) do
53
53
  include Inversion::AbstractClass
54
- def self::name; "ZebraTag"; end
54
+ def self::name; "Inversion::Template::ZebraTag"; end
55
55
  end
56
56
  end
57
57
  result = Inversion::Template::Tag.load_all
@@ -66,6 +66,28 @@ describe Inversion::Template::Tag do
66
66
  }.to raise_error( ArgumentError, /invalid tag name/i )
67
67
  end
68
68
 
69
+
70
+ it "includes support for snake_case tag names" do
71
+ pluginfile = '/usr/lib/ruby/gems/1.8/gems/inversion-extra-1.0.8/lib/inversion/template/two_hump_camel_tag.rb'
72
+ expect( Gem ).to receive( :find_files ).
73
+ with( Inversion::Template::Tag::TAG_PLUGIN_PATTERN ).
74
+ and_return([ pluginfile ])
75
+ expect( Inversion::Template::Tag ).to receive( :require ) do |filename|
76
+ expect( filename ).to eq( 'inversion/template/two_hump_camel_tag' )
77
+ Class.new( Inversion::Template::Tag ) do
78
+ def self::name; "Inversion::Template::TwoHumpCamelTag"; end
79
+ end
80
+ end
81
+ result = Inversion::Template::Tag.load_all
82
+ expect( result ).to be_a( Hash )
83
+ expect( result.size ).to eq( 2 )
84
+ expect( result ).to have_key( :twohumpcamel )
85
+ expect( result ).to have_key( :two_hump_camel )
86
+ expect( result[:two_hump_camel] ).to be_a( Class )
87
+ expect( result[:two_hump_camel] ).to be < Inversion::Template::Tag
88
+ end
89
+
90
+
69
91
  describe "concrete subclass" do
70
92
 
71
93
  before( :each ) do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inversion
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.16.0
4
+ version: 0.17.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Granger
@@ -31,7 +31,7 @@ cert_chain:
31
31
  c7ZKPJcWBv0sm81+FCZXNACn2f9jfF8OQinxVs0O052KbGuEQaaiGIYeuuwQE2q6
32
32
  ggcrPfcYeTwWlfZPu2LrBg==
33
33
  -----END CERTIFICATE-----
34
- date: 2015-01-15 00:00:00.000000000 Z
34
+ date: 2015-01-16 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: loggability
metadata.gz.sig CHANGED
Binary file