b_b 0.1.2 → 0.1.3

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -2
  3. data/lib/b_b.rb +13 -6
  4. data/lib/b_b/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1167e370ed10d02f35473348b1a70e9e7ec24ea
4
- data.tar.gz: 9e210cb38ea4990f034199ac4a7edd023f81b137
3
+ metadata.gz: d54a68b4d017f46b01d54426bac23a31f2f3b90d
4
+ data.tar.gz: 2f35e172dabfaa3130d56f9019f3752c82116e0d
5
5
  SHA512:
6
- metadata.gz: c7582169f1bc3cc75f3469b2ac4f1b3f1b065f829f1f2277469e87d8726cf871bcd57839e416ae8ed201c003954e9f3be8d9270f6dc5d411ccb080e0cf6cb27e
7
- data.tar.gz: f78ae32dd07a7d218a2879c24c45dc3e03ae8c27dbb3e356eb5bd747608ed8b43a087133acf6eadd69e092ac651a06854f488185f70edabc0b70649c37b9ba82
6
+ metadata.gz: 2d04e963de4c761c02dc2eb95bdda3bf2c2086f51cd1e32ce652cfa3bc2c9b909a6da8d814f65979fef3a9bb8e9e85f31f67d5b27da8964d39b59e452305647f
7
+ data.tar.gz: 736045fb04fdf1e17261cb754ddae50ea52c39671855070b18d976a89a431fb58d4146b6c7a0e07c021154d02c1836f9f2a4c99e57d0255d9adf7313c472e176
data/README.md CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  (b_b) is SQL Query Builder for [Google BigQuery](https://cloud.google.com/bigquery)
4
4
 
5
+ [![Gem Version](https://badge.fury.io/rb/b_b.svg)](https://badge.fury.io/rb/b_b)
5
6
  [![Dependency Status](https://gemnasium.com/badges/github.com/yhirano55/b_b.svg)](https://gemnasium.com/github.com/yhirano55/b_b)
6
7
  [![Build Status](https://travis-ci.org/yhirano55/b_b.svg?branch=master)](https://travis-ci.org/yhirano55/b_b)
7
- [![Coverage Status](https://coveralls.io/repos/github/yhirano55/b_b/badge.svg?branch=master)](https://coveralls.io/github/yhirano55/b_b?branch=master)
8
+ [![Coverage Status](https://coveralls.io/repos/github/yhirano55/b_b/badge.svg?branch=master&key=201607161500)](https://coveralls.io/github/yhirano55/b_b?branch=master)
8
9
  [![codebeat badge](https://codebeat.co/badges/5e694b1a-93b1-4fda-ad6e-3dc0d5afe76b)](https://codebeat.co/projects/github-com-yhirano55-b_b)
9
10
 
10
11
  ## Install
@@ -37,6 +38,8 @@ Query Reference of BigQuery's query syntax and functions is [here](https://cloud
37
38
 
38
39
  ## Examples
39
40
 
41
+ L(b_b)z ==============33
42
+
40
43
  ### SELECT clause
41
44
 
42
45
  ```ruby
@@ -134,7 +137,7 @@ BB.having("first CONTAINS :first AND negram_count < :negram_count", first: "a",
134
137
  # => "HAVING (first CONTAINS 'a' AND ngram_count < 10000)"
135
138
 
136
139
  BB.having(first: "a").or.not.having(first: "b").to_sql
137
- => "HAVING (first = 'a') OR (first <> 'b')"
140
+ # => "HAVING (first = 'a') OR (first <> 'b')"
138
141
  ```
139
142
 
140
143
  ### ORDER BY clause
data/lib/b_b.rb CHANGED
@@ -45,14 +45,21 @@ module BB
45
45
  }.freeze
46
46
 
47
47
  class << self
48
- def build
49
- relation = Relation.new
50
- yield(relation)
51
- relation.to_sql
48
+ # Delegate to BB::Relation
49
+ def method_missing(method, *args, &block)
50
+ return super unless relation.respond_to?(method)
51
+ relation.send(method, *args, &block)
52
52
  end
53
53
 
54
- def method_missing(name, *args)
55
- Relation.new.public_send(name, *args)
54
+ # Delegate to BB::Relation
55
+ def respond_to?(method, include_all = false)
56
+ relation.respond_to?(method, include_all) || super
57
+ end
58
+
59
+ private
60
+
61
+ def relation
62
+ Relation.new
56
63
  end
57
64
  end
58
65
  end
@@ -1,3 +1,3 @@
1
1
  module BB
2
- VERSION = "0.1.2".freeze
2
+ VERSION = "0.1.3".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: b_b
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoshiyuki Hirano