eql 0.0.1 → 0.0.2

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2aec3fe36fce2efd0f4d5fd05f4ae6c8822c83a0
4
- data.tar.gz: a00651310daeb5909ba5a4538ad7f3067764ed97
3
+ metadata.gz: 7e33f72aa2566593bd50d1c463141b7d9537b1c8
4
+ data.tar.gz: 4b3ad6517ece31d344173518e79ccd027f07e0c9
5
5
  SHA512:
6
- metadata.gz: 478099d1d7c7ca2f10d7e9df0a774350e7ee5e9ceda5fd8858f4351e8f44545c5713055571a06720299dfc9019f3b368828f22913cbb542ce1939cb1fbddc3eb
7
- data.tar.gz: a95e2015c4e01699ae5b136e00e2065add263afa0cf1d92e0a5016fa830ad37dafc7680b50c382bc75967a311d9dd83deee7daf05f34ab5159adc8eb50767c3b
6
+ metadata.gz: ea8ca0cb04bbc77c9fee071dd06baf02ec825a05987bcd8e44e2ca50cde1427d16b0d3d98296da13e0c43f73ad0a286e9ee76863d5797b9bc2504637e528ea95
7
+ data.tar.gz: b301f3a1dac9231422892b655946b92ca567f102fcc6133977f74ef38ddd892f87c5f9c20e92f8b0f1b04ab6fe8187e83109bdbea80dd028b90ddc5e5dc3c7e6
data/README.md CHANGED
@@ -20,17 +20,17 @@ gem 'eql'
20
20
  ### Simple usage
21
21
 
22
22
  ```erb
23
- # queries/update.sql.erb
23
+ # queries/insert.sql.erb
24
24
  <% each do |item| %>
25
25
  INSERT INTO items (category, name)
26
- VALUES (<%= item.values_at(:category, :name).map { |i| quote(i) }.join(', ')) %>
27
- ON CONFILICT (category, name) DO NOTHING
26
+ VALUES (<%= item.values_at(:category, :name).map { |i| quote(i) }.join(', ') %>)
27
+ ON CONFILICT (category, name) DO NOTHING;
28
28
  <% end %>
29
29
  ```
30
30
 
31
31
  ```ruby
32
32
  b = Eql.new('queries')
33
- b.execute(update, [{category: 'cars', name: 'BMW'}, {category: 'cars', name: 'AUDI'}])
33
+ b.execute(:insert, [{category: 'cars', name: 'BMW'}, {category: 'cars', name: 'AUDI'}])
34
34
  ```
35
35
 
36
36
  ### Inline templates
@@ -41,7 +41,7 @@ b = Eql.template <<-ERB
41
41
  FROM customer c
42
42
  LEFT JOIN products p ON (c.id = p.customer_id)
43
43
  WHERE c.id = <%= quote(id) %>
44
- ERD
44
+ ERB
45
45
  b.execute_params(id: 74)
46
46
  ```
47
47
 
@@ -70,7 +70,7 @@ SELECT *
70
70
 
71
71
  ### Create your own adapter
72
72
 
73
- ```
73
+ ```ruby
74
74
  class BashAdapter < Eql::Adapters::Base
75
75
  def self.match?(conn)
76
76
  conn == :my_bash
@@ -97,7 +97,7 @@ b.template <<-COMMAND
97
97
  ls folder/*
98
98
  COMMAND
99
99
  b.execute_params(folder: 'units')
100
- ``
100
+ ```
101
101
 
102
102
  ### Adapters
103
103
  Now implemented only `ActiveRecord` adapter. Please, fill free to contribute on
data/lib/eql/proxy.rb CHANGED
@@ -25,7 +25,7 @@ module Eql
25
25
  #
26
26
  # @return [String] returns rendered template
27
27
  #
28
- def render(tmpl, params = nil)
28
+ def render(tmpl, params = @params)
29
29
  b = @builder.clone
30
30
  b.load(tmpl, params)
31
31
  b.render
data/lib/eql/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Eql
2
2
  # @return [String] returns gem version
3
- VERSION = '0.0.1'
3
+ VERSION = '0.0.2'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eql
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oleg Yashchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-25 00:00:00.000000000 Z
11
+ date: 2017-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -80,7 +80,7 @@ dependencies:
80
80
  - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
- description: Create a raw query to your DB via ERB templates
83
+ description: Erb provides an ability to use ERB templates with your DB queries
84
84
  email:
85
85
  - oazoer@gmail.com
86
86
  executables: []