lynx 1.0.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of lynx might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: bb25acb5e2f9862705f64406d8331573cf85265f
4
- data.tar.gz: 96659f856db07bfede52db5a010d7d8ab1e4229b
2
+ SHA256:
3
+ metadata.gz: 2e1c07539c52c2024441a5adb94e7eb4bba2396c816c49bc634976b682109fe7
4
+ data.tar.gz: c6668a0b215de782010ce559dee56e9f9f5d708cb04bb3bdf17b78517777d017
5
5
  SHA512:
6
- metadata.gz: 3f355457fd19658583ae6aa91d514ea7a0b8141dbbdd5561091fbcb164fd7820e699fbf2ec60a4f2b3bba174f8dc9fd844fd783b5d957f2ad05488aeae0a99b0
7
- data.tar.gz: be365cd897648d469625ea40c0af6f478f30da1732142c7603acc635c19cf5ef6863e1148d5fede7c417484b671d411de3627da9a1041220757685ac538e41eb
6
+ metadata.gz: 84e68f51e8816b440887b647a72abc1a9603682d36d4a876ab63be91460d1d7bb8f0de8c4cec6250edb6fe1653a42a3909acc27faef0cbf708b1fb4cb9c76076
7
+ data.tar.gz: 0c1dca3d3e71496d49ba8acdfc170d9f978622b156b19790319ad2f8b71ac1b72367fff2426b199491616e13cbb77d706fe15a1b72614b911f09bb4ee0c35138
data/CHANGES.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # master (unreleased)
2
2
 
3
+ # 1.1.1
4
+
5
+ * Fix `exists?` to `exist?` for Ruby 3.2+. (mkasberg)
6
+
7
+ # 1.1.0
8
+
9
+ * Add `if [not] exists` support for creating/dropping DBs. (sshistrava)
10
+ * Remove support for MySQL 5.5 commands. (sshistrava)
11
+
3
12
  # 1.0.0
4
13
 
5
14
  * Removed `--password` support. (sshistrava)
data/lib/lynx/config.rb CHANGED
@@ -1,9 +1,8 @@
1
1
  module Lynx
2
2
  class Config
3
- MYSQL = ['mysql', 'mysql5', '/usr/local/bin/mysql', '/opt/local/bin/mysql5',
4
- '/usr/local/mysql/bin/mysql']
3
+ MYSQL = ['mysql', '/usr/local/bin/mysql', '/usr/local/mysql/bin/mysql']
5
4
 
6
- DUMP = ['mysqldump', 'mysqldump5']
5
+ DUMP = ['mysqldump']
7
6
 
8
7
  def initialize(config = {})
9
8
  @config = config
data/lib/lynx/d_s_l.rb CHANGED
@@ -21,6 +21,13 @@ module Lynx
21
21
  .sql("create database #{@config.database}")
22
22
  end
23
23
 
24
+ def create_database_if_not_exists
25
+ Command::Basic.new(@config)
26
+ .mysql
27
+ .authorize
28
+ .sql("create database if not exists #{@config.database}")
29
+ end
30
+
24
31
  def drop_database
25
32
  Command::Basic.new(@config)
26
33
  .mysql
@@ -28,6 +35,13 @@ module Lynx
28
35
  .sql("drop database #{@config.database}")
29
36
  end
30
37
 
38
+ def drop_database_if_exists
39
+ Command::Basic.new(@config)
40
+ .mysql
41
+ .authorize
42
+ .sql("drop database if exists #{@config.database}")
43
+ end
44
+
31
45
  def dump
32
46
  Command::Dump.new(@config)
33
47
  .authorize
data/lib/lynx/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lynx
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.1"
3
3
  end
data/lib/lynx.rb CHANGED
@@ -17,7 +17,7 @@ module Lynx
17
17
  if defined?(Rails)
18
18
  env ||= Rails.env
19
19
  hash = Rails.configuration.database_configuration
20
- elsif File.exists?('config/database.yml')
20
+ elsif File.exist?('config/database.yml')
21
21
  hash = YAML::load(ERB.new(IO.read('config/database.yml')).result)
22
22
  else
23
23
  raise RuntimeError, 'unable to find configuration file'
@@ -0,0 +1,10 @@
1
+ require 'minitest/autorun'
2
+ require 'lynx'
3
+
4
+ describe Lynx do
5
+ it 'attempts to config from Rails' do
6
+ assert_raises(RuntimeError, 'unable to find configuration file') do
7
+ Lynx.rails
8
+ end
9
+ end
10
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lynx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pan Thomakos
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-12 00:00:00.000000000 Z
11
+ date: 2024-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -75,6 +75,7 @@ files:
75
75
  - test/lib/lynx/command/dump_test.rb
76
76
  - test/lib/lynx/config_test.rb
77
77
  - test/lib/lynx/d_s_l_test.rb
78
+ - test/lib/lynx/main_test.rb
78
79
  - test/lib/lynx/pipe/append_test.rb
79
80
  - test/lib/lynx/pipe/get_test.rb
80
81
  - test/lib/lynx/pipe/p_open_test.rb
@@ -83,7 +84,7 @@ files:
83
84
  homepage: https://www.github.com/panthomakos/lynx
84
85
  licenses: []
85
86
  metadata: {}
86
- post_install_message:
87
+ post_install_message:
87
88
  rdoc_options: []
88
89
  require_paths:
89
90
  - lib
@@ -98,9 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
99
  - !ruby/object:Gem::Version
99
100
  version: '0'
100
101
  requirements: []
101
- rubyforge_project:
102
- rubygems_version: 2.6.11
103
- signing_key:
102
+ rubygems_version: 3.4.19
103
+ signing_key:
104
104
  specification_version: 4
105
105
  summary: Ruby command line wrapper for MySQL.
106
106
  test_files:
@@ -108,9 +108,9 @@ test_files:
108
108
  - test/lib/lynx/command/dump_test.rb
109
109
  - test/lib/lynx/config_test.rb
110
110
  - test/lib/lynx/d_s_l_test.rb
111
+ - test/lib/lynx/main_test.rb
111
112
  - test/lib/lynx/pipe/append_test.rb
112
113
  - test/lib/lynx/pipe/get_test.rb
113
114
  - test/lib/lynx/pipe/p_open_test.rb
114
115
  - test/lib/lynx/pipe/write_test.rb
115
116
  - test/lib/lynx/system_out_test.rb
116
- has_rdoc: