tmp 2.0.1 → 2.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: 5845fa5e63e71ef13c656bb1161314c9c467fb8f
4
- data.tar.gz: 3dbca526a0a8200558e915347cc9875564c93a3f
3
+ metadata.gz: fc1456cbbe0bb30447c73afdca9f8af01405b477
4
+ data.tar.gz: 3835bb393ee46825c863deafea76cc3414d3b1ee
5
5
  SHA512:
6
- metadata.gz: f87c903ecee3f656fb877919ab449ab5eb6d24109fb0c7b08fd5fd4329700037e3ce89d400ad2c28e248e9e8764f9c7f60a3c7b3d0342cc9f5a3375a11067d1b
7
- data.tar.gz: 5469500af2dd31a6accba39d73e43c5e7fd47b639860cd071fbeba79ca6551c69d0f4c9c7f20967b59772921c157c1b02733bdf912b59934d8deb816b3a1d34c
6
+ metadata.gz: 670b014328b82c5d13d189dfe8c59294acfc6d858b65fc2980882841e67c5b012aeb239db82e2468efd91d7f6440ed2ff78ab0210ab662157d7932359263c416
7
+ data.tar.gz: 3e63d13b47ad3782ea776b26ab7d916a83d8a1d41f59c99c0975aa4bd815d70a814960a50b68ef4dbd65ccf2a8e8460a9935c73e6b5a5aa323abc07ed5e40fd5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tmp (2.0.1)
4
+ tmp (2.1.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -29,7 +29,7 @@ The DSL will make easy the job on you but you can use the default methods alike:
29
29
 
30
30
  require 'tmp'
31
31
 
32
- #> you can use the __TMP__ alias as well
32
+ #> you can use the __TMP__ / __tmp__ alias as well
33
33
  tmp.hello = { hello: 'world'}
34
34
 
35
35
  # defined variable
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.1
1
+ 2.1.0
data/examples/test.rb CHANGED
@@ -1 +1,7 @@
1
- # all set! :)
1
+ require 'tmp'
2
+
3
+ __TMP__.test= {hello: "world"}
4
+
5
+ puts __TMP__.test
6
+ __TMP__.test= nil
7
+ puts __TMP__.test.inspect
data/lib/tmp/dsl.rb CHANGED
@@ -1,15 +1,11 @@
1
1
  #encoding: UTF-8
2
2
  module TMP
3
3
 
4
-
5
4
  module DSLCore
6
5
 
7
6
  def target_obj obj=nil
8
7
 
9
- unless obj.nil?
10
- @target_obj= obj
11
- end
12
-
8
+ @target_obj= obj unless obj.nil?
13
9
  @target_obj || ::TMP
14
10
 
15
11
  end
@@ -18,8 +14,9 @@ module TMP
18
14
 
19
15
  @target_methods = [:write,:read,:file]
20
16
 
21
- if method.to_s.include?('=')
22
- target_obj.__send__ @target_methods[0], method.to_s.gsub('=',''), args.first
17
+ if method.to_s.reverse[0] == '='
18
+ target_obj.__send__ @target_methods[0], method.to_s.reverse.sub('=','').reverse, args.first
19
+ return args.first
23
20
  else
24
21
 
25
22
  unless block.nil?
@@ -62,8 +59,8 @@ module TMP
62
59
  ::TMP::DSL
63
60
  end
64
61
 
65
- alias :temporally :tmp
66
62
  alias :__TMP__ :tmp
63
+ alias :__tmp__ :tmp
67
64
 
68
65
  end
69
66
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tmp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Luzsi