yard 0.5.1p1 → 0.5.1

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

Potentially problematic release.


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

data/ChangeLog CHANGED
@@ -1,18 +1,5 @@
1
- 2009-12-16 Loren Segal <lsegal@soen.ca>
2
-
3
- * ChangeLog, lib/yard.rb: Bump version to 0.5.1p1
4
-
5
- * lib/yard/cli/yri.rb, lib/yard/core_ext/file.rb, lib/yard/registry_store.rb,
6
- lib/yard/serializers/file_system_serializer.rb, spec/core_ext/file_spec.rb:
7
- Ensure '~/.yard' path is created before writing certain config files. - Adds
8
- File.open! to ensure path exists before writing file Closes gh-57
9
-
10
- * lib/yard/registry_store.rb: Return true/false in RegistryStore#load!
11
-
12
1
  2009-12-15 Loren Segal <lsegal@soen.ca>
13
2
 
14
- * docs/WhatsNew.md: Forgot to add version number for changes
15
-
16
3
  * ChangeLog, README.md, lib/yard.rb, yard.gemspec: Bump version to 0.5.1
17
4
 
18
5
  * docs/WhatsNew.md: Update What's New document
@@ -1,5 +1,5 @@
1
1
  module YARD
2
- VERSION = "0.5.1p1"
2
+ VERSION = "0.5.1"
3
3
  ROOT = File.dirname(__FILE__)
4
4
  TEMPLATE_ROOT = File.join(File.dirname(__FILE__), '..', 'templates')
5
5
  CONFIG_DIR = File.expand_path('~/.yard')
@@ -42,7 +42,7 @@ module YARD
42
42
  return if path == Registry.yardoc_file
43
43
  @cache[name] = path
44
44
 
45
- File.open!(CACHE_FILE, 'w') do |file|
45
+ File.open(CACHE_FILE, 'w') do |file|
46
46
  @cache.each do |key, value|
47
47
  file.puts("#{key} #{value}")
48
48
  end
@@ -1,5 +1,3 @@
1
- require 'fileutils'
2
-
3
1
  class File
4
2
  RELATIVE_PARENTDIR = '..'
5
3
  RELATIVE_SAMEDIR = '.'
@@ -42,11 +40,4 @@ class File
42
40
  end
43
41
  File.join(*path)
44
42
  end
45
-
46
- # Forces opening a file (for writing) by first creating the file's directory
47
- def self.open!(file, *args, &block)
48
- dir = dirname(file)
49
- FileUtils.mkdir_p(dir) unless directory?(dir)
50
- open(file, *args, &block)
51
- end
52
43
  end
@@ -94,12 +94,8 @@ module YARD
94
94
  # @return [Boolean] whether the database was loaded
95
95
  # @see #load_all
96
96
  def load!(file = nil)
97
- if load(file)
98
- load_all
99
- true
100
- else
101
- false
102
- end
97
+ load(file)
98
+ load_all
103
99
  end
104
100
 
105
101
  # Loads all cached objects into memory
@@ -224,11 +220,11 @@ module YARD
224
220
  end
225
221
 
226
222
  def write_proxy_types
227
- File.open!(proxy_types_path, 'wb') {|f| f.write(Marshal.dump(@proxy_types)) }
223
+ File.open(proxy_types_path, 'wb') {|f| f.write(Marshal.dump(@proxy_types)) }
228
224
  end
229
225
 
230
226
  def write_checksums
231
- File.open!(checksums_path, 'w') do |f|
227
+ File.open(checksums_path, 'w') do |f|
232
228
  @checksums.each {|k, v| f.puts("#{k} #{v}") }
233
229
  end
234
230
  end
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  module YARD
2
4
  module Serializers
3
5
  class FileSystemSerializer < Base
@@ -26,8 +28,9 @@ module YARD
26
28
  # @return [String] the written data (for chaining)
27
29
  def serialize(object, data)
28
30
  path = File.join(basepath, *serialized_path(object))
31
+ FileUtils.mkdir_p File.dirname(path)
29
32
  log.debug "Serializing to #{path}"
30
- File.open!(path, "wb") {|f| f.write data }
33
+ File.open(path, "wb") {|f| f.write data }
31
34
  end
32
35
 
33
36
  # Implements the serialized path of a code object.
@@ -45,20 +45,4 @@ describe File do
45
45
  File.cleanpath('C/../../D').should == "../D"
46
46
  end
47
47
  end
48
-
49
- describe '.open!' do
50
- it "should create the path before opening" do
51
- File.should_receive(:directory?).with('/path/to').and_return(false)
52
- FileUtils.should_receive(:mkdir_p).with('/path/to')
53
- File.should_receive(:open).with('/path/to/file', 'w')
54
- File.open!('/path/to/file', 'w')
55
- end
56
-
57
- it "should just open the file if the path exists" do
58
- File.should_receive(:directory?).with('/path/to').and_return(true)
59
- FileUtils.should_not_receive(:mkdir_p)
60
- File.should_receive(:open).with('/path/to/file', 'w')
61
- File.open!('/path/to/file', 'w')
62
- end
63
- end
64
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1p1
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Loren Segal
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-16 00:00:00 -05:00
12
+ date: 2009-12-15 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -371,9 +371,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
371
371
  version:
372
372
  required_rubygems_version: !ruby/object:Gem::Requirement
373
373
  requirements:
374
- - - ">"
374
+ - - ">="
375
375
  - !ruby/object:Gem::Version
376
- version: 1.3.1
376
+ version: "0"
377
377
  version:
378
378
  requirements: []
379
379