auto_sql_formatter 0.1.1 → 0.1.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
  SHA256:
3
- metadata.gz: b400f6cb9005cd9caf412e2b9a7109d6e85fd28805efbb97f4613ca59c97c40f
4
- data.tar.gz: d4f74bf8a1e545911229967226b1f3ad601dd73d27b7ccb514f7453dd53178af
3
+ metadata.gz: e1ea4694b7ff164331937fae76acee83461f0e25c2e13913e9c56db53d9b54b8
4
+ data.tar.gz: cb70a8d2147a5310e803bcd8a9ff0ec144d75f402ca1327e8390d0c748f771cc
5
5
  SHA512:
6
- metadata.gz: 3aaff527171abb4c149a4b5987f4f02d62f738d37c362af377c95308cbfffcfae7ade069194411d167fad95b55b55cdd3d96db29190c064ed83202f43a10f7d5
7
- data.tar.gz: 7092111e81614f6a4c5a9f3ac33830537f2e1ba3b9f985d9a0439e21e9ea68f41176be50a0b83f2592eb7a547b1aa74f29bce646040aacc2f060091a2be80c21
6
+ metadata.gz: 998f96ea871c3da30a93a86315e3b695ec683e2b42c56aeea01fcd12ccc1fd1fa8e596748beb442a83f4d6e242bd224f92655e1ac5902643e9b8538dcd4564c1
7
+ data.tar.gz: a751262365900abd524e1fea531e69c1f5b24b1272b891ca45c086e745dacc8e0ecf6b176bf2bebf13c054601276bb711341b8298b8a055de81b7916c7a5c2a9
@@ -0,0 +1,2 @@
1
+ # 0.1.2
2
+ - Implement basic function
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- auto_sql_formatter (0.1.1)
4
+ auto_sql_formatter (0.1.2)
5
+ export_strings (~> 0.2)
5
6
 
6
7
  GEM
7
8
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -1,11 +1,4 @@
1
- # AutoSqlFormatter
2
- - In development
3
- - Release schedule after July
4
-
5
- <!-- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/auto_sql_formatter`. To experiment with that code, run `bin/console` for an interactive prompt.
6
-
7
- TODO: Delete this and the text above, and describe your gem
8
-
1
+ # AutoSqlFormatter ※ In development
9
2
  ## Installation
10
3
 
11
4
  Add this line to your application's Gemfile:
@@ -16,7 +9,7 @@ gem 'auto_sql_formatter'
16
9
 
17
10
  And then execute:
18
11
 
19
- $ bundle
12
+ $ bundle install
20
13
 
21
14
  Or install it yourself as:
22
15
 
@@ -24,22 +17,33 @@ Or install it yourself as:
24
17
 
25
18
  ## Usage
26
19
 
27
- TODO: Write usage instructions here
20
+ ```rb
21
+ require 'auto_sql_formatter'
22
+
23
+ # In your irb concole
24
+
25
+ AutoSqlFormatter.execute dir_path # default = app
26
+ # ========Start to format sql=========
28
27
 
29
- ## Development
28
+ # SSS..
30
29
 
31
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+ # example/example2.rb success
31
+ # example/example3.rb success
32
+ # example/example.rb success
33
+ # example/example4.rb none
34
+ # example/example5.rb none
32
35
 
33
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
36
+ # ===========Completed!!!============
37
+
38
+ # Or bundle exec auto_sql_formatter dir
39
+ bundle exec sql_format
40
+
41
+ ```
34
42
 
35
43
  ## Contributing
36
44
 
37
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/auto_sql_formatter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
45
+ Bug reports and pull requests are welcome on GitHub at https://github.com/tashirosota/ruby-export_strings. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
38
46
 
39
47
  ## License
40
48
 
41
49
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
42
-
43
- ## Code of Conduct
44
-
45
- Everyone interacting in the AutoSqlFormatter project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/auto_sql_formatter/blob/master/CODE_OF_CONDUCT.md). -->
@@ -34,6 +34,8 @@ Gem::Specification.new do |spec|
34
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
35
35
  spec.require_paths = ["lib"]
36
36
 
37
+ spec.add_dependency "export_strings", "~> 0.2"
38
+ # spec.add_dependency "thor"
37
39
  spec.add_development_dependency "bundler", "~> 1.17"
38
40
  spec.add_development_dependency "rake", "~> 10.0"
39
41
  spec.add_development_dependency "rspec", "~> 3.0"
@@ -1,5 +1,6 @@
1
1
  require "auto_sql_formatter/version"
2
2
  require "auto_sql_formatter/core"
3
+ # require "auto_sql_formatter/cli"
3
4
 
4
5
  module AutoSqlFormatter
5
6
  def self.execute(path = nil)
@@ -0,0 +1,10 @@
1
+ require 'thor'
2
+
3
+ module AutoSqlFormatter
4
+ class CLI < Thor
5
+ def auto_sql_formatter
6
+ # TODO
7
+ Core.new(path).execute
8
+ end
9
+ end
10
+ end
@@ -21,7 +21,6 @@ module AutoSqlFormatter
21
21
 
22
22
  body = URI.encode_www_form(sql: sql, keyword_case: DEFAULT_CASE)
23
23
 
24
- '===Net::HTTP==='
25
24
  response = https.post(uri.path, body, HEADERS)
26
25
  JSON.parse(response.body)['result']
27
26
  end
@@ -16,7 +16,7 @@ module AutoSqlFormatter
16
16
  # }
17
17
  # ]
18
18
  results = Formatter.do sqls
19
- results.each { |result| file_text.gsub! /#{result[:from]}/m, result[:to] }
19
+ results.each { |result| file_text.gsub! result[:from], result[:to] }
20
20
  return 'success' if File.open(path, 'w') { |f| f.write file_text }
21
21
  end
22
22
  class Error < StandardError; end
@@ -1,3 +1,3 @@
1
1
  module AutoSqlFormatter
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auto_sql_formatter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tashiro
@@ -10,6 +10,20 @@ bindir: exe
10
10
  cert_chain: []
11
11
  date: 2019-06-08 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: export_strings
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.2'
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: bundler
15
29
  requirement: !ruby/object:Gem::Requirement
@@ -79,6 +93,7 @@ files:
79
93
  - example/example5.rb
80
94
  - lib/.DS_Store
81
95
  - lib/auto_sql_formatter.rb
96
+ - lib/auto_sql_formatter/cli.rb
82
97
  - lib/auto_sql_formatter/core.rb
83
98
  - lib/auto_sql_formatter/formatter.rb
84
99
  - lib/auto_sql_formatter/runner.rb