rebel 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/rebel/sql.rb +12 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4183b987662f827d6b32d29a8ab27c296dacdb82
4
- data.tar.gz: 3835ab7325bb2262aa2433be7056265ed6adc0b5
3
+ metadata.gz: 484cad6b2851562dd80774e3249577df2bc3a6f4
4
+ data.tar.gz: ab2aff65c3a66184915f4fa396cc8c0d8bff42d0
5
5
  SHA512:
6
- metadata.gz: 9586ef0f6aca3e96c5283817d8b61ad54d24f90a9018817eeca1223041a3a31e36c428919172a16c79e318c767f00e12f510d23483e778ec53da1431d9849e73
7
- data.tar.gz: f3f8eebeefaf6614e02f35b61a20475083ee77037b8f6169732cb49323a11bce9c3f91b4b5695e571c4df049ce55216097f823392d4f1e91e2b64314919945d8
6
+ metadata.gz: 82f4a246958333b03b0b201fd926dd62c18ff71d36ac8368b314f7c14d13f3f630f2cabca7ccd0ba7ace4c3f23b8a8e9e73e3ba6fb652768f50b79c4aa170de3
7
+ data.tar.gz: 2ef7487ccb43443f5167ec6260ba850573c9e3ca1109c0959d5c4b7ee27ad77a1beb7d4747234686b935b2703e374b01d85e2fe81ca4bbf4dce0efcde6188e3c
@@ -13,7 +13,7 @@ module Rebel::SQL
13
13
  exec(Rebel::SQL.drop_table(table_name))
14
14
  end
15
15
 
16
- def select(*fields, distinct: distinct, from: nil, where: nil, inner: nil, left: nil, right: nil, group: nil, order: nil, limit: nil, offset: nil)
16
+ def select(*fields, distinct: nil, from: nil, where: nil, inner: nil, left: nil, right: nil, group: nil, order: nil, limit: nil, offset: nil)
17
17
  exec(Rebel::SQL.select(*fields,
18
18
  distinct: distinct,
19
19
  from: from,
@@ -105,10 +105,12 @@ module Rebel::SQL
105
105
  def and(*clause)
106
106
  Raw.new("#{self.parens?} AND #{Rebel::SQL.and_clause(*clause)}")
107
107
  end
108
+ alias & and
108
109
 
109
110
  def or(*clause)
110
111
  Raw.new("#{self} OR #{Rebel::SQL.and_clause(*clause)}").wants_parens!
111
112
  end
113
+ alias | or
112
114
 
113
115
  def eq(n)
114
116
  case n
@@ -130,6 +132,7 @@ module Rebel::SQL
130
132
  end
131
133
  end
132
134
  alias != ne
135
+ alias is_not ne
133
136
 
134
137
  def lt(n)
135
138
  Raw.new("#{self} < #{Rebel::SQL.name_or_value(n)}")
@@ -155,9 +158,17 @@ module Rebel::SQL
155
158
  Raw.new("#{self} IN (#{Rebel::SQL.values(*v)})")
156
159
  end
157
160
 
161
+ def not_in(*v)
162
+ Raw.new("#{self} NOT IN (#{Rebel::SQL.values(*v)})")
163
+ end
164
+
158
165
  def like(n)
159
166
  Raw.new("#{self} LIKE #{Rebel::SQL.value(n)}")
160
167
  end
168
+
169
+ def not_like(n)
170
+ Raw.new("#{self} NOT LIKE #{Rebel::SQL.value(n)}")
171
+ end
161
172
  end
162
173
 
163
174
  @identifier_quote = '"'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rebel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loic Nageleisen