ragdoll-cli 0.0.2 → 0.1.8

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: f19f7c89cad761c7da655010fdc868b7124ab164d0481cf2d97dea485df58317
4
- data.tar.gz: c2c7be844cc5addcd4386c4ea0596c75abe9cbbb29167b218ee95826a9c98ace
3
+ metadata.gz: 37690a904a95405edf1f83bcc0655d0933028ba81dc9d16862f2e46a197c86e2
4
+ data.tar.gz: 352ab870d8581d97b4aa0f53906614c5a4c1c07128cd7392693b810bef75a685
5
5
  SHA512:
6
- metadata.gz: 27c20b905c6fa11a5941a8c1343b01b37affd6d84fd4e3884733988031c2e91f7336c351fc7da90474c68bc4b951cae37b3b3d2d6f85e25f010d19d3110ef43a
7
- data.tar.gz: 121b9df6c28f2ed96ddfaf2f00468b7f53aced41b04ed77dca015ec8690e801e3fd10dfc8567737b3448835bb7010234b11630e53a68a494064b8f089a3654ba
6
+ metadata.gz: c49805896f34f099dc5a87421df3697996cb34700c371f75df37b587eb9984d6f81032b7b3b4457226fbcad2ebfa67cec1fb23f66665dc964bbbf490c6c71d91
7
+ data.tar.gz: e8183a1904f7a3877319d11a8e96110f9570ba036af175fe92dcd1b4dffe9cfbdd119c555af6d3edc8d49ee364121b2a2da32abd56e5cd49e55a4c1bc447a104
data/Rakefile CHANGED
@@ -16,6 +16,12 @@ Rake::TestTask.new(:test) do |t|
16
16
  end
17
17
 
18
18
  # Load annotate tasks
19
- Dir.glob("lib/tasks/*.rake").each { |r| load r }
19
+ Dir.glob("lib/tasks/*.rake").each do |r|
20
+ begin
21
+ load r
22
+ rescue LoadError => e
23
+ puts "Skipping #{r}: #{e.message}" if ENV['DEBUG']
24
+ end
25
+ end
20
26
 
21
27
  task default: :test
@@ -15,7 +15,7 @@ module Ragdoll
15
15
  return unless yes?('Confirm deletion?')
16
16
  end
17
17
 
18
- result = client.delete_document(id: id)
18
+ result = client.delete_document(id)
19
19
 
20
20
  if result[:success]
21
21
  puts "Document ID #{id} deleted successfully."
@@ -29,8 +29,9 @@ module Ragdoll
29
29
  private
30
30
 
31
31
  def yes?(question)
32
- require 'highline/import'
33
- agree("#{question} (y/n) ")
32
+ print "#{question} (y/n) "
33
+ response = $stdin.gets.chomp.downcase
34
+ response == 'y' || response == 'yes'
34
35
  end
35
36
  end
36
37
  end
@@ -19,7 +19,7 @@ module Ragdoll
19
19
  search_options[:keywords] = options[:keywords].split(',').map(&:strip) if options[:keywords]
20
20
  search_options[:tags] = options[:tags].split(',').map(&:strip) if options[:tags]
21
21
 
22
- search_response = client.search(query, **search_options)
22
+ search_response = client.search(query: query, **search_options)
23
23
 
24
24
  # Extract the actual results array from the response
25
25
  results = search_response[:results] || search_response['results'] || []
@@ -18,7 +18,7 @@ module Ragdoll
18
18
  return
19
19
  end
20
20
 
21
- result = client.update_document(id: id, **update_options)
21
+ result = client.update_document(id, update_options)
22
22
 
23
23
  if result[:success]
24
24
  puts "Document ID #{id} updated successfully."
@@ -6,10 +6,8 @@ require 'fileutils'
6
6
  module Ragdoll
7
7
  module CLI
8
8
  class ConfigurationLoader
9
- DEFAULT_CONFIG_PATH = File.expand_path('~/.ragdoll/config.yml')
10
-
11
9
  def initialize
12
- @config_path = ENV['RAGDOLL_CONFIG'] || DEFAULT_CONFIG_PATH
10
+ @config_path = nil
13
11
  end
14
12
 
15
13
 
@@ -41,25 +39,27 @@ module Ragdoll
41
39
  'log_file' => File.expand_path('~/.ragdoll/ragdoll.log')
42
40
  }
43
41
 
44
- File.write(@config_path, YAML.dump(default_config))
42
+ File.write(config_path, YAML.dump(default_config))
45
43
  default_config
46
44
  end
47
45
 
48
46
 
49
47
  def config_exists?
50
- File.exist?(@config_path)
48
+ File.exist?(config_path)
51
49
  end
52
50
 
53
- attr_reader :config_path
51
+ def config_path
52
+ @config_path ||= ENV['RAGDOLL_CONFIG'] || File.expand_path('~/.ragdoll/config.yml')
53
+ end
54
54
 
55
55
  private
56
56
 
57
57
  def load_config_file
58
58
  return create_default_config unless config_exists?
59
59
 
60
- YAML.load_file(@config_path)
60
+ YAML.load_file(config_path)
61
61
  rescue StandardError => e
62
- puts "Warning: Could not load config file #{@config_path}: #{e.message}"
62
+ puts "Warning: Could not load config file #{config_path}: #{e.message}"
63
63
  puts 'Using default configuration.'
64
64
  create_default_config
65
65
  end
@@ -136,7 +136,7 @@ module Ragdoll
136
136
 
137
137
 
138
138
  def ensure_config_directory
139
- config_dir = File.dirname(@config_path)
139
+ config_dir = File.dirname(config_path)
140
140
  FileUtils.mkdir_p(config_dir) unless Dir.exist?(config_dir)
141
141
  end
142
142
  end
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Ragdoll
5
5
  module CLI
6
- VERSION = "0.0.2"
6
+ VERSION = "0.1.8"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ragdoll-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dewayne VanHoozer