itamae-mitsurin 0.49 → 0.50

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: f519fd44a8b4e97837b902588325a3d02247af5e
4
- data.tar.gz: 8e8288b6e876a6d1c5c7a265786a6247df20413e
3
+ metadata.gz: 24e20da5d3a61cb0db137e79d80c5ef5e47951f2
4
+ data.tar.gz: 50ade042e38c73694307396f626b2fe37135262b
5
5
  SHA512:
6
- metadata.gz: e1fc3b6694b46554f6c6bbf87636c1e0933b788f4d574c4e077911273ba5e9a67b01e869c1059d4907005769325b1c032c556250aaa9ef78074ee8d69a64e9b7
7
- data.tar.gz: d464ef05750dc5938fb820e99ed1f2d313c6f6dee984c7f1f09f3c0818762e4de84feb313c2a78e9cbb7f95700a0408b64634c1bbe6165651de88e7c623d7dae
6
+ metadata.gz: d6718987fe3f358415af4711389f3107e7e38f64f72aa875042136290aafca9ff1248d70bc60888d190c092a775db9125d7f6d9dcbd3de8a5fb8f8dd97efc596
7
+ data.tar.gz: f5e5dfdb90173448bda7771e761e1cb7b3c582c3877bd7d987406481a256ed4ea54391732518238b70a608e5dc1ed575d31331216750189faad1bec9591438f3
@@ -7,9 +7,6 @@ module ItamaeMitsurin
7
7
  class HttpRequest < File
8
8
  RedirectLimitExceeded = Class.new(StandardError)
9
9
 
10
- # alias_method :_action_create, :action_create
11
- # undef_method :action_create, :action_delete, :action_edit
12
-
13
10
  define_attribute :action, default: :get
14
11
  define_attribute :headers, type: Hash, default: {}
15
12
  define_attribute :message, type: String, default: ""
@@ -17,23 +14,6 @@ module ItamaeMitsurin
17
14
  define_attribute :url, type: String, required: true
18
15
 
19
16
  def pre_action
20
- # attributes.exist = true
21
- # attributes.content = fetch_content
22
- #
23
- # send_tempfile
24
- # compare_file
25
- # end
26
- #
27
- # def show_differences
28
- # current.mode = current.mode.rjust(4, '0') if current.mode
29
- # attributes.mode = attributes.mode.rjust(4, '0') if attributes.mode
30
- #
31
- # super
32
- #
33
- # show_content_diff
34
- # end
35
-
36
- #def fetch_content
37
17
  uri = URI.parse(attributes.url)
38
18
  response = nil
39
19
  redirects_followed = 0
@@ -42,11 +22,11 @@ module ItamaeMitsurin
42
22
  http = Net::HTTP.new(uri.host, uri.port)
43
23
  http.use_ssl = true if uri.scheme == "https"
44
24
 
45
- case attributes.action
25
+ case @current_action
46
26
  when :delete, :get, :options
47
- response = http.method(attributes.action).call(uri.request_uri, attributes.headers)
27
+ response = http.method(@current_action).call(uri.request_uri, attributes.headers)
48
28
  when :post, :put
49
- response = http.method(attributes.action).call(uri.request_uri, attributes.message, attributes.headers)
29
+ response = http.method(@current_action).call(uri.request_uri, attributes.message, attributes.headers)
50
30
  end
51
31
 
52
32
  if response.kind_of?(Net::HTTPRedirection)
@@ -65,32 +45,26 @@ module ItamaeMitsurin
65
45
  attributes.content = response.body
66
46
 
67
47
  super
68
- #response.body
69
48
  end
70
49
 
71
50
  def action_delete(options)
72
51
  action_create(options)
73
- # _action_create(options)
74
52
  end
75
53
 
76
54
  def action_get(options)
77
55
  action_create(options)
78
- # _action_create(options)
79
56
  end
80
57
 
81
58
  def action_options(options)
82
59
  action_create(options)
83
- # _action_create(options)
84
60
  end
85
61
 
86
62
  def action_post(options)
87
63
  action_create(options)
88
- # _action_create(options)
89
64
  end
90
65
 
91
66
  def action_put(options)
92
- # action_create(options)
93
- _action_create(options)
67
+ action_create(options)
94
68
  end
95
69
  end
96
70
  end
@@ -1 +1 @@
1
- 0.49
1
+ 0.50
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itamae-mitsurin
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.49'
4
+ version: '0.50'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Akihiro Kamiyama
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-01 00:00:00.000000000 Z
11
+ date: 2017-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor