freshli-commons 0.6.7 → 0.6.9

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
  SHA256:
3
- metadata.gz: d240b4214d3146f9ac2a850f8bbec234cc081e730ccf2e404c1d230e4c7d31b2
4
- data.tar.gz: 2307b0714f44f51a154e9d74ae73f0b88cac082e0f2e25b9898b8c9a763991e2
3
+ metadata.gz: ed4130177375f38b13b4c684a54d8b171b4ea6f48b67efd493636bf8770ffd74
4
+ data.tar.gz: dfab40ebf656be66b4c0a1d5ffc8d09e7f0b910f028a7745758a3aac81573b71
5
5
  SHA512:
6
- metadata.gz: 6db1d2dc787cc06685ab40d62cc2bee3ebd97f419778f020761c049218e2cf5e7aa9732d91c809f1719063d2f256b90bd823f797fdd5a769e1946868168a0cae
7
- data.tar.gz: da480f259e5248d35807e37cc52a9044ee6f0218d69a53e5083a0d42b640fcdf9c94bda1ad1c163dfbdce827e46c0118ab102bfd73562fcc17be762b81dc5d99
6
+ metadata.gz: b59266efc08a92611c0fd8fdae19499acfe97c4dc91247d91036d412249432bc2ba520a0ec6ba28ed3ad0ed13130b6fb6fa27f37851b00cd7f17be6911eb75d8
7
+ data.tar.gz: 504b854746f684fe79a97a776be54e6691a8dfc0b6d1852b323d1557e2ada188b2e21051d86deacac69e2597b178a2d88d960b259dfa628a2415d4f0f70d60eb
data/Rakefile CHANGED
@@ -1,10 +1,43 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'git-version-bump'
4
+
5
+ def version_file
6
+ File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'corgibytes', 'freshli', 'commons', 'version.rb'))
7
+ end
8
+
9
+ def version_file_contents
10
+ <<~VERSION_FILE
11
+ # frozen_string_literal: true
12
+
13
+ module Corgibytes
14
+ module Freshli
15
+ module Commons
16
+ VERSION = '#{GVB.version}'
17
+ end
18
+ end
19
+ end
20
+ VERSION_FILE
21
+ end
22
+
23
+ def write_version
24
+ File.write(version_file, version_file_contents)
25
+ load_version
26
+ end
27
+
28
+ def load_version
29
+ return if require_relative version_file
30
+
31
+ # forcefully reload version file if it was already loaded
32
+ Corgibytes::Freshli::Commons.send(:remove_const, :VERSION)
33
+ load(version_file)
34
+ end
35
+
36
+ write_version
37
+
3
38
  require 'bundler/gem_tasks'
4
39
  require 'rspec/core/rake_task'
5
40
 
6
- require 'git-version-bump'
7
-
8
41
  require 'fileutils'
9
42
 
10
43
  # TODO: Copy the `freshli_agent.proto` from the `corgibytes/freshli` repository
@@ -75,22 +108,16 @@ RuboCop::RakeTask.new
75
108
  namespace :version do
76
109
  desc "Persist the the current version number as #{GVB.version}"
77
110
  task :persist do
78
- version_file = File.expand_path(File.join(File.dirname(__FILE__), 'lib', 'corgibytes', 'freshli', 'commons', 'version.rb'))
79
- version_file_contents = <<~VERSION_FILE
80
- module Corgibytes
81
- module Freshli
82
- module Commons
83
- VERSION = '#{GVB.version}'
84
- end
85
- end
86
- end
87
- VERSION_FILE
88
- File.write(version_file, version_file_contents)
111
+ write_version
112
+ end
113
+
114
+ task :show do
115
+ puts "Current version #{Corgibytes::Freshli::Commons::VERSION}"
89
116
  end
90
117
  end
91
118
 
92
119
  # Ensure that the grpc files are generated before the build runs
93
- Rake::Task['build'].enhance(['grpc', 'version:bump:patch', 'version:persist'])
120
+ Rake::Task['build'].enhance(['grpc', 'version:show'])
94
121
 
95
122
  task default: %i[grpc spec rubocop]
96
123
 
@@ -98,31 +125,31 @@ task default: %i[grpc spec rubocop]
98
125
  # to avoid an issue that was causing the version number of the `git-version-bump` gem to be used instead
99
126
  # of this gem's version. That's because of how the `GVB.version` method determines the calling file.
100
127
  namespace :version do
101
- namespace :bump do
102
- desc "bump major version (x.y.z -> x+1.0.0)"
103
- task :major do
104
- GVB.tag_version "#{GVB.major_version + 1}.0.0"
128
+ namespace :bump do
129
+ desc 'bump major version (x.y.z -> x+1.0.0)'
130
+ task :major do
131
+ GVB.tag_version "#{GVB.major_version + 1}.0.0"
105
132
 
106
- puts "Version is now #{GVB.version}"
107
- end
133
+ puts "Version is now #{GVB.version}"
134
+ end
108
135
 
109
- desc "bump minor version (x.y.z -> x.y+1.0)"
110
- task :minor do
111
- GVB.tag_version "#{GVB.major_version}.#{GVB.minor_version+1}.0"
136
+ desc 'bump minor version (x.y.z -> x.y+1.0)'
137
+ task :minor do
138
+ GVB.tag_version "#{GVB.major_version}.#{GVB.minor_version + 1}.0"
112
139
 
113
- puts "Version is now #{GVB.version}"
114
- end
140
+ puts "Version is now #{GVB.version}"
141
+ end
115
142
 
116
- desc "bump patch version (x.y.z -> x.y.z+1)"
117
- task :patch do
118
- GVB.tag_version "#{GVB.major_version}.#{GVB.minor_version}.#{GVB.patch_version+1}"
143
+ desc 'bump patch version (x.y.z -> x.y.z+1)'
144
+ task :patch do
145
+ GVB.tag_version "#{GVB.major_version}.#{GVB.minor_version}.#{GVB.patch_version + 1}"
119
146
 
120
- puts "Version is now #{GVB.version}"
121
- end
147
+ puts "Version is now #{GVB.version}"
148
+ end
122
149
 
123
- desc "Print current version"
124
- task :show do
125
- puts GVB.version
126
- end
127
- end
150
+ desc 'Print current version'
151
+ task :show do
152
+ puts GVB.version
153
+ end
154
+ end
128
155
  end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Corgibytes
2
4
  module Freshli
3
5
  module Commons
4
- VERSION = '0.6.7'
6
+ VERSION = '0.6.9'
5
7
  end
6
8
  end
7
9
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: freshli-commons
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.7
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - M. Scott Ford
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-05 00:00:00.000000000 Z
11
+ date: 2023-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba