lite-query 1.0.3 → 1.0.4

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
  SHA256:
3
- metadata.gz: bd95c4ff3c5191d97c37ab8e737e1c80cf08e9a0708a7c4b351a68a3b5546670
4
- data.tar.gz: ff3ff5c6cf0dfe87a0ae33d2bad88c1974f5ef927dfb393cc5d148cabd1dcae2
3
+ metadata.gz: 6e3dfe1a485ad4a6a5886f1d83e8569410b92d46d394a6b3a13671c1c0e94689
4
+ data.tar.gz: bde018db4b76b6126a15e799cda50ff1d2db51160a37eb379e65879c15725c0e
5
5
  SHA512:
6
- metadata.gz: dab3b35c73b7394fd180793eec7b5d288004d5d46e065cb8977be66fe8e50d6d2abec4f1ec002d0a76a0cf42fc3676576497957f54feb797447f491afca174a5
7
- data.tar.gz: 186610afe7add973513ef975e999a77fa108d94dbb87db5b2ad627701686e13e63cd88bf4682d94af478fc821d66ff8492a0415a3758cd9fd93d1fb8dff664b2
6
+ metadata.gz: 5b1b27a42809e122d2994bb65748922da7fc4b2fe07b4ed7a4f3d10cd897a5cb64188921fa757e17273daf086938b5afcccefa01b03c3276304e56824aba757f
7
+ data.tar.gz: dd7fd542d4bff2a592f9084735b8fcd5ee2fd2210e037df8319a237127ea5fd680390bc0811f57496031f0c1d8a95af3cd944e45e4b11f635cbf84dc9676a598
data/CHANGELOG.md CHANGED
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.0.4] - 2019-09-02
10
+ ### Changed
11
+ - Changed generator syntax
12
+
9
13
  ## [1.0.3] - 2019-09-02
10
14
  ### Changed
11
15
  - Changed generator syntax
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lite-query (1.0.3)
4
+ lite-query (1.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -39,9 +39,7 @@ end
39
39
 
40
40
  Use `rails g query NAME` will generate the following file: `../app/queries/[name]_query.rb`
41
41
 
42
- *(This will also add available test framework files if detected)*
43
-
44
- You will then need to fill this class with the required `execute` method
42
+ You will then need to fill this class with the required `execute` method as shown below:
45
43
 
46
44
  ```ruby
47
45
  class AgeQuery < ApplicationQuery
@@ -14,7 +14,13 @@ module Rails
14
14
  template('query.rb.tt', path)
15
15
  end
16
16
 
17
- hook_for :test_framework
17
+ def copy_specs
18
+ return unless defined?(RSpec)
19
+
20
+ path = File.join('spec', 'queries', class_path, "#{file_name}_query_spec.rb")
21
+ empty_directory('spec/queries')
22
+ template('spec.rb.tt', path)
23
+ end
18
24
 
19
25
  private
20
26
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  <% module_namespacing do -%>
2
4
  class <%= class_name %>Query < ApplicationQuery
3
5
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rails_helper'
2
4
 
3
5
  RSpec.describe <%= class_name %>Query, type: :query do
@@ -3,7 +3,7 @@
3
3
  module Lite
4
4
  module Query
5
5
 
6
- VERSION ||= '1.0.3'
6
+ VERSION ||= '1.0.4'
7
7
 
8
8
  end
9
9
  end
data/lib/lite/query.rb CHANGED
@@ -5,7 +5,4 @@
5
5
  end
6
6
 
7
7
  require 'generators/lite/query/install_generator'
8
-
9
- %w[rails rspec test_unit].each do |name|
10
- require "generators/#{name}/query_generator"
11
- end
8
+ require 'generators/rails/query_generator'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lite-query
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
@@ -191,10 +191,7 @@ files:
191
191
  - lib/generators/rails/USAGE
192
192
  - lib/generators/rails/query_generator.rb
193
193
  - lib/generators/rails/templates/query.rb.tt
194
- - lib/generators/rspec/query_generator.rb
195
- - lib/generators/rspec/templates/query_spec.rb.tt
196
- - lib/generators/test_unit/query_generator.rb
197
- - lib/generators/test_unit/templates/query_test.rb.tt
194
+ - lib/generators/rails/templates/spec.rb.tt
198
195
  - lib/lite/query.rb
199
196
  - lib/lite/query/base.rb
200
197
  - lib/lite/query/exceptions.rb
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails/generators'
4
-
5
- module Rspec
6
- module Generators
7
- class QueryGenerator < Rails::Generators::NamedBase
8
-
9
- source_root File.expand_path('../templates', __FILE__)
10
-
11
- def copy_files
12
- path = File.join('spec', 'queries', class_path, "#{file_name}_query_spec.rb")
13
- empty_directory('spec/queries')
14
- template('query_spec.rb.tt', path)
15
- end
16
-
17
- private
18
-
19
- def file_name
20
- @_file_name ||= remove_possible_suffix(super)
21
- end
22
-
23
- def remove_possible_suffix(name)
24
- name.sub(/_?query$/i, '')
25
- end
26
-
27
- end
28
- end
29
- end
@@ -1,30 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rails/generators'
4
-
5
- module TestUnit
6
- module Generators
7
- class QueryGenerator < Rails::Generators::NamedBase
8
-
9
- source_root File.expand_path('../templates', __FILE__)
10
- check_class_collision suffix: 'QueryTest'
11
-
12
- def copy_files
13
- path = File.join('test', 'queries', class_path, "#{file_name}_query_test.rb")
14
- empty_directory('test/queries')
15
- template('query_test.rb.tt', path)
16
- end
17
-
18
- private
19
-
20
- def file_name
21
- @_file_name ||= remove_possible_suffix(super)
22
- end
23
-
24
- def remove_possible_suffix(name)
25
- name.sub(/_?query$/i, '')
26
- end
27
-
28
- end
29
- end
30
- end
@@ -1,9 +0,0 @@
1
- require 'test_helper'
2
-
3
- <% module_namespacing do -%>
4
- class <%= class_name %>QueryTest < ActiveSupport::TestCase
5
- # test "the truth" do
6
- # assert true
7
- # end
8
- end
9
- <% end -%>