expressive 0.0.34 → 0.0.35

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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ODlkZmFjOWNhM2Q1NGNkYzA0ZTMyNjQ2MDljMDlhMGEwNGYwNmE0OQ==
4
+ Yzg1YTRmMzc4ZWE0Y2YzNmFiODRjNGViZGZlYTk0ZDA0YWE3ODE2Mg==
5
5
  data.tar.gz: !binary |-
6
- YWE4MDQ0ZWQ0YzI1NDJmODQ4MzlmOTViYTkxNWRiNWE2NDMzYjI4Ng==
6
+ NTcyM2M0NjRiMjJjODBhZTcyYjNiZjQwYzdhNjNmNWEyMmEzZDZlZQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZmNmODRiZGU3ZTE3ZTVmMGY0NWZmMzY1MTlkMjdmNDM1MmJjOWU4ZTE3ZWVk
10
- M2FjOTg1NWI2MDc5YmZiZDQ4Mzg5OGMwNjFmNjQ5NGRlMWEyMWYyNzZiNzk0
11
- NjY5MGUzYWQ5NGMxYmJjNjkxMTljYjk2OWMwODg4ZjQxZDY0ZDY=
9
+ MWFkMmNlZjRjM2QyYWJlOWUxNGQyNGY1YTZkZmRhZTdlZGFlZTcxZmE2ODU4
10
+ M2VkNjk2NTkyZDJhZDlmNDg1NjcyZTIwM2IyYTM0MWYwYmY1Mjk3NTYxZjY5
11
+ NWJiMTQ3NWNkNjQwM2YxNmQyYWFmMDI0OGY0MzM3NmE0ZmI2YWE=
12
12
  data.tar.gz: !binary |-
13
- OTFiMDQ4NTFkMTAzZWRlZmUyMWFlYjcyNmFhMjM4OGI1YTQ5ODRkZTE4ZTA4
14
- Y2VhNmNjYTExYmQ0YWE1MmIyZjQ4NDhiYzRjOTU2NDZhNmU4OTY0NGQ2MWE1
15
- MGMzNTEzOTc4NWRhZDRjNTZiNTIyMzEzOGY0ZTUyNTljZDZhZjU=
13
+ YjlkMGZhNDkxYzc2ODVlMGRiNTViMjFlZjM1MjQzMWUyOTIyNDBlN2I2YWQy
14
+ YzgxNGMxNTNlN2YwYTdhZWZmMTZiZmM5NWE4ZjE2ZGExZDljMzBlYmNlYjVj
15
+ NTY1ZjAzYzM5ZmFmMzBkNDUxMWI3ZDNiMjZlZmE3M2NiMDBmZGU=
@@ -35,7 +35,7 @@ module Expressive
35
35
  end
36
36
 
37
37
  def self.all_symbols
38
- %w(+ - * / = set sum $sub post >= > < <= and or if date datetime get put lookup $lookup $head $tail $reverse round $round $days_ago $hours_ago $minutes_ago $append $id $hash $concat $split $sms $hval $index $random $join $not)
38
+ %w(+ - * / = set sum $sub post >= > < <= and or if date datetime get put lookup $lookup $head $tail $reverse round $round $days_ago $hours_ago $minutes_ago $append $id $hash $concat $split $sms $hval $index $random $join $not $include)
39
39
  end
40
40
 
41
41
  module Boolean
@@ -1,3 +1,3 @@
1
1
  module Expressive
2
- VERSION = "0.0.34"
2
+ VERSION = "0.0.35"
3
3
  end
@@ -187,6 +187,7 @@ module Expressive
187
187
  define('$hours_ago'){|*args| Time.now - args[0].to_i * 3600 }
188
188
  define('$minutes_ago'){|*args| Time.now - args[0].to_i * 60 }
189
189
  define('$head'){|*args| args.flatten.first }
190
+ define('$include'){|val, arr| arr.include?(val) }
190
191
  define('$tail'){|*args| args.flatten[1..-1] }
191
192
  define('$reverse'){|*args| args.flatten.reverse }
192
193
  define('$not'){|*args| not args.first }
@@ -6,7 +6,7 @@ describe "Expressive" do
6
6
  end
7
7
 
8
8
  describe "all_symbols" do
9
- it { Expressive.all_symbols.should =~ %w(+ - * / = set sum $sub get put post >= > < <= and or if date datetime lookup round $round $days_ago $hours_ago $minutes_ago $append $id $head $lookup $reverse $tail $hash $concat $split $sms $hval $index $random $join $not) }
9
+ it { Expressive.all_symbols.should =~ %w(+ - * / = set sum $sub get put post >= > < <= and or if date datetime lookup round $round $days_ago $hours_ago $minutes_ago $append $id $head $lookup $reverse $tail $hash $concat $split $sms $hval $index $random $join $not $include) }
10
10
  end
11
11
 
12
12
  describe "understands booleans" do
@@ -84,6 +84,10 @@ describe "Expressive" do
84
84
 
85
85
  describe "understands list operations" do
86
86
  it { Expressive.run("($head (1 2 3))").should eql 1 }
87
+ it { Expressive.run("($include 3 (1 2 3))").should eql true }
88
+ it { Expressive.run("($include 4 (1 2 3))").should eql false }
89
+ it { Expressive.run("($include ADAM001 (ADAM001 AIBO001 AMBR001 BARC002 BARC003))").should eql true}
90
+ it { Expressive.run("($include BDAM001 (ADAM001 AIBO001 AMBR001 BARC002 BARC003))").should eql true}
87
91
  it { Expressive.run("($tail (1 2 3))").should eql [2, 3] }
88
92
  it { Expressive.run("($reverse (1 2 3))").should eql [3 ,2 ,1] }
89
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: expressive
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.34
4
+ version: 0.0.35
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ijonas Kisselbach
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-08 00:00:00.000000000 Z
11
+ date: 2014-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby_gntp