bicho 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4a0d062e368708076439568e705310a5434de9ba
4
- data.tar.gz: 7bf1e89725b8870dd8d87d5b5f5747b419cbd284
3
+ metadata.gz: 2760edd7531e71e8047f5043ca304271d784185e
4
+ data.tar.gz: c99dbcd06578f5dbde10fd773cb32652a113877d
5
5
  SHA512:
6
- metadata.gz: 12e08de436746cfb6c9453ea300a24571a686848ed15c882c51a49f7fc0d85b8f00d45d51db05b8d28917e36231c9581491ae377e137afb40a4026af922d92f8
7
- data.tar.gz: 00bd9161bc8120b63570dd6d8f7d9fdd0fd878bfe4cbbf8a0d415ddbdecb1920f64cd1dc2f4873a2cc5323b69cfb1c7851e53485bd7e6bb7441a9d68827f319e
6
+ metadata.gz: 962b69c57522a18ab23ab6245f100f9d3f66ab227c5537232ef5ee1d0b861ee959bd05528ffdb6604075c0057f3dd074a56fe7ef6d9b04dba24d87b7b3a11377
7
+ data.tar.gz: 5b5b087d28f2fd5a467d4bac125ed41d192f2c0fc40cae050d6f583baa8a2426494117da9a4b9463b9ad7dc11bd5ef959b20dbae253694f6b9ef942fb189a4c3
@@ -56,8 +56,13 @@ module Bicho
56
56
  @data = data
57
57
  end
58
58
 
59
- def method_missing(name, *_args)
60
- @data[name.to_s]
59
+ def method_missing(method_name, *_args)
60
+ return super unless @data.key?(method_name.to_s)
61
+ @data[method_name.to_s]
62
+ end
63
+
64
+ def respond_to_missing?(method_name, _include_private = false)
65
+ @data.key?(method_name.to_s) || super
61
66
  end
62
67
 
63
68
  def id
@@ -238,7 +238,7 @@ module Bicho
238
238
  end
239
239
  when Net::HTTPRedirection
240
240
  location = response['location']
241
- if redirects_left == 0
241
+ if redirects_left.zero?
242
242
  raise "Maximum redirects exceeded (redirected to #{location})"
243
243
  end
244
244
  new_location_uri = URI.parse(location)
@@ -62,13 +62,20 @@ module Bicho
62
62
  # Query responds to all the bug search attributes.
63
63
  #
64
64
  # @see {Bug.where Allowed attributes}
65
- def method_missing(name, *args)
65
+ def method_missing(method_name, *args)
66
+ return super unless Bicho::SEARCH_FIELDS
67
+ .map(&:first)
68
+ .include?(method_name)
66
69
  args.each do |arg|
67
- append_query(name.to_s, arg)
70
+ append_query(method_name.to_s, arg)
68
71
  end
69
72
  self
70
73
  end
71
74
 
75
+ def respond_to_missing?(method_name, _include_private = false)
76
+ Bicho::SEARCH_FIELDS.map(&:first).include?(method_name) || super
77
+ end
78
+
72
79
  # Shortcut equivalent to status new, assigned, needinfo and reopened
73
80
  def open
74
81
  status(:new).status(:assigned).status(:needinfo).status(:reopened)
@@ -1,3 +1,3 @@
1
1
  module Bicho
2
- VERSION = '0.0.12'.freeze
2
+ VERSION = '0.0.13'.freeze
3
3
  end
@@ -15,7 +15,7 @@ class NovellPluginTest < Minitest::Test
15
15
  site_url = plugin.transform_site_url_hook(url, log)
16
16
  api_url = plugin.transform_api_url_hook(url, log)
17
17
  assert_equal(site_url.to_s, "http://bugzilla.#{domain}.com")
18
- assert_equal(api_url.to_s, 'https://test:test@apibugzilla.novell.com')
18
+ assert_equal(api_url.to_s, "https://test:test@apibugzilla.#{domain}.com")
19
19
  assert_match(/Rewrote url/, r.gets)
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bicho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Duncan Mac-Vicar P.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-02 00:00:00.000000000 Z
11
+ date: 2016-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inifile