gitarro 0.1.5 → 0.1.52

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: 859b3feea91e36029b92c7cdbaf639cbcb370952
4
- data.tar.gz: fcb4a18b402ec2934c1661d4f3e1a3204daffba7
3
+ metadata.gz: 9394fd417107857cfbf9e58db40b1478605986aa
4
+ data.tar.gz: d939f4b1b3210fa0693a1fc7b5365cbb710b0f60
5
5
  SHA512:
6
- metadata.gz: 56237f9e270268ff8cb9c0b6894d8783e7f1d17c4a741e2c5d0fb36e9be7d4bf8ee8e0654aa6451d71ca492314a7096b6566d30610c8803c24a3304199aef110
7
- data.tar.gz: 5ab12186520ce1bbd706a9edf285c186402c242bc66c808fe906ce697b386008b3bd03587c6d733f8fd8d466b9e503b082db84b0a441e949d94a6065f7c4a761
6
+ metadata.gz: 62e98475342aee2a999c3d7b1b831f56f6bcbc947897f23740e6b6c8e4c7325335372fa4d13a9c9e05b0ade36c7bb208e8d7eddf0af97ff929e9c060745ccc39
7
+ data.tar.gz: 9a395dd70ecc830c6febfdbae0f65baf4e2d68714315d380d3cdeaa929830119dc9edd87d01c3b078e1c4f61b462678a3685bff00c5f74197ae4e8040059ade3
@@ -79,13 +79,13 @@ end
79
79
  module CachingOctokit
80
80
  def create_dir_store(cache_path)
81
81
  cache_name = 'httpcache'
82
- full_cache_dir = "#{cache_path}#{cache_name}"
82
+ full_cache_dir = "#{cache_path}/#{cache_name}"
83
83
  ActiveSupport::Cache::FileStore.new(full_cache_dir)
84
84
  end
85
85
 
86
86
  def generate_cache(httpcache_path)
87
87
  # changed_since cannot work with cache
88
- return false if dont_generate_cache?
88
+ return false unless generate_cache?
89
89
  stack = Faraday::RackBuilder.new do |builder|
90
90
  builder.use Faraday::HttpCache,
91
91
  store: create_dir_store(httpcache_path),
@@ -97,13 +97,9 @@ module CachingOctokit
97
97
  Octokit.middleware = stack
98
98
  end
99
99
 
100
- # if true we dont need the cache
101
- def dont_generate_cache?
102
- return false unless @changed_since > 0
103
- puts '###############################'
104
- puts 'NO HTTP Faraday Cache generated!'
105
- puts '###############################'
106
- true
100
+ # by default is false, enable only via option
101
+ def generate_cache?
102
+ @cachehttp
107
103
  end
108
104
  end
109
105
 
@@ -182,6 +182,7 @@ class OptParserInternal
182
182
  @options[:target_url] = '' if @options[:target_url].nil?
183
183
  @options[:https] = false if @options[:https].nil?
184
184
  @options[:changed_since] = -1 if @options[:changed_since].nil?
185
+ @options[:cachehttp] = false if @options[:cachehttp].nil?
185
186
  end
186
187
 
187
188
  def defaults_to_text
@@ -189,7 +190,6 @@ class OptParserInternal
189
190
  @options[:file_type] = '.changes' if @options[:changelog_test]
190
191
  @options[:description] = desc if @options[:description].nil?
191
192
  @options[:file_type] = 'notype' if @options[:file_type].nil?
192
- @options[:cachehttp] = '/tmp/gitarro' if @options[:cachehttp].nil?
193
193
  end
194
194
  end
195
195
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gitarro
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.52
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dario Maiocchi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-10 00:00:00.000000000 Z
11
+ date: 2017-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: english