Class Index [+]

Quicksearch

Jeweler::VersionHelper::YamlExtension

Public Instance Methods

parse_yaml() click to toggle source
    # File lib/jeweler/version_helper.rb, line 28
28:       def parse_yaml
29:         yaml = read_yaml
30:         @major = (yaml['major'] || yaml[:major]).to_i
31:         @minor = (yaml['minor'] || yaml[:minor]).to_i
32:         @patch = (yaml['patch'] || yaml[:patch]).to_i
33:         @build = (yaml['build'] || yaml[:build])
34:       end
path() click to toggle source
    # File lib/jeweler/version_helper.rb, line 44
44:       def path
45:         yaml_path
46:       end
read_yaml() click to toggle source
    # File lib/jeweler/version_helper.rb, line 36
36:       def read_yaml
37:         if File.exists?(yaml_path)
38:           YAML.load_file(yaml_path)
39:         else
40:           raise VersionYmlError, "#{yaml_path} does not exist!"
41:         end
42:       end
refresh() click to toggle source
    # File lib/jeweler/version_helper.rb, line 24
24:       def refresh
25:         parse_yaml
26:       end
to_hash() click to toggle source
    # File lib/jeweler/version_helper.rb, line 15
15:       def to_hash
16:         {
17:           :major => major,
18:           :minor => minor,
19:           :patch => patch,
20:           :build => build
21:         }
22:       end
write() click to toggle source
    # File lib/jeweler/version_helper.rb, line 9
 9:       def write
10:         File.open(yaml_path, 'w+') do |f|
11:           YAML.dump(self.to_hash, f)
12:         end
13:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.