huginn_agent 0.6.1 → 0.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +34 -7
- data/lib/huginn_agent/spec_runner.rb +6 -6
- data/lib/huginn_agent/templates/newagent/Rakefile.tt +1 -1
- data/lib/huginn_agent/templates/newagent/lib/new_agent/new_agent.rb.tt +1 -1
- data/lib/huginn_agent/templates/newagent/lib/new_agent.rb.tt +3 -0
- data/lib/huginn_agent/version.rb +1 -1
- data/lib/huginn_agent.rb +14 -2
- data/spec/lib/huginn_agent/cli/new_spec.rb +8 -8
- data/spec/lib/huginn_agent/spec_runner_spec.rb +1 -1
- data/spec/lib/huginn_agent_spec.rb +4 -4
- metadata +20 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fbf31ce876fc5932b67910ad88cddc5b671ff71f1f26f1c8309e0b4ee06865a1
|
|
4
|
+
data.tar.gz: 47ea4315bf9f7cc204767fef2f4de3fba555e2276500b974be210bdbb8fdaefa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ff4b1d1a560a395feaca0112467c31b6f58c82546569154d969f7346ac4a58bf2e189dd9bd0db26997ff7b66df3ba69ba76082bebeb165c283f39f4a2fbf5516
|
|
7
|
+
data.tar.gz: 4e509923c31c4a7170044041d6c77c3a80c291a1a0c57dbb71026332dd723df51df2f7c22ab4e396535de39a195d62bdd3fc698fb4f03df3cea27d4d98f519ff
|
data/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,31 @@ All notable changes to this project will be documented in this file.
|
|
|
10
10
|
|
|
11
11
|
### Fixed
|
|
12
12
|
|
|
13
|
+
## [0.6.2] - 2026-04-05
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
|
|
17
|
+
- Use shallow clone (`--depth 1`) when cloning and fetching the Huginn source for running specs
|
|
18
|
+
- Replace deprecated `Bundler.with_clean_env` with `Bundler.with_unbundled_env`
|
|
19
|
+
- Remove Rails classic loader fallback in favor of Zeitwerk only
|
|
20
|
+
- Loosen development dependency version constraints
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- Replace deprecated `File.exists?` with `File.exist?`
|
|
25
|
+
|
|
26
|
+
## [0.6.1] - 2017-09-22
|
|
27
|
+
|
|
28
|
+
### Added
|
|
29
|
+
|
|
30
|
+
- Example code for the `working` method when generating a new Agent gem
|
|
31
|
+
|
|
32
|
+
### Changed
|
|
33
|
+
|
|
34
|
+
- Use `.env.example` file from Huginn when running the specs and no custom `.env` file is found, allows to run the specs as long as all Huginn dependencies are installed
|
|
35
|
+
|
|
36
|
+
### Fixed
|
|
37
|
+
|
|
13
38
|
## [0.6.0] - 2017-04-12
|
|
14
39
|
|
|
15
40
|
### Changed
|
|
@@ -71,10 +96,12 @@ All notable changes to this project will be documented in this file.
|
|
|
71
96
|
- First official and working release
|
|
72
97
|
|
|
73
98
|
|
|
74
|
-
[Unreleased]: https://github.com/
|
|
75
|
-
[0.6.
|
|
76
|
-
[0.
|
|
77
|
-
[0.
|
|
78
|
-
[0.
|
|
79
|
-
[0.4.
|
|
80
|
-
[0.4.
|
|
99
|
+
[Unreleased]: https://github.com/huginn/huginn_agent/compare/v0.6.2...HEAD
|
|
100
|
+
[0.6.2]: https://github.com/huginn/huginn_agent/compare/v0.6.1...v0.6.2
|
|
101
|
+
[0.6.1]: https://github.com/huginn/huginn_agent/compare/v0.6.0...v0.6.1
|
|
102
|
+
[0.6.0]: https://github.com/huginn/huginn_agent/compare/v0.5.0...v0.6.0
|
|
103
|
+
[0.5.0]: https://github.com/huginn/huginn_agent/compare/v0.4.3...v0.5.0
|
|
104
|
+
[0.4.3]: https://github.com/huginn/huginn_agent/compare/v0.4.2...v0.4.3
|
|
105
|
+
[0.4.2]: https://github.com/huginn/huginn_agent/compare/v0.4.1...v0.4.2
|
|
106
|
+
[0.4.1]: https://github.com/huginn/huginn_agent/compare/v0.4.0...v0.4.1
|
|
107
|
+
[0.4.0]: https://github.com/huginn/huginn_agent/compare/f6e307e2ec1679367ecc43ab265b8f68d6fe12f2...v0.4.0
|
|
@@ -10,14 +10,14 @@ class HuginnAgent
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def clone
|
|
13
|
-
unless File.
|
|
14
|
-
shell_out "git clone #{HuginnAgent.remote} -b #{HuginnAgent.branch} spec/huginn", 'Cloning huginn source ...'
|
|
13
|
+
unless File.exist?('spec/huginn/.git')
|
|
14
|
+
shell_out "git clone --depth 1 #{HuginnAgent.remote} -b #{HuginnAgent.branch} spec/huginn", 'Cloning huginn source ...'
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def reset
|
|
19
19
|
Dir.chdir('spec/huginn') do
|
|
20
|
-
shell_out "git fetch && git reset --hard origin/#{HuginnAgent.branch}", 'Resetting Huginn source ...'
|
|
20
|
+
shell_out "git fetch --depth 1 && git reset --hard origin/#{HuginnAgent.branch}", 'Resetting Huginn source ...'
|
|
21
21
|
end
|
|
22
22
|
end
|
|
23
23
|
|
|
@@ -30,11 +30,11 @@ class HuginnAgent
|
|
|
30
30
|
end
|
|
31
31
|
|
|
32
32
|
def bundle
|
|
33
|
-
if File.
|
|
33
|
+
if File.exist?('.env')
|
|
34
34
|
shell_out "cp .env spec/huginn"
|
|
35
35
|
end
|
|
36
36
|
Dir.chdir('spec/huginn') do
|
|
37
|
-
if !File.
|
|
37
|
+
if !File.exist?('.env')
|
|
38
38
|
shell_out "cp .env.example .env"
|
|
39
39
|
end
|
|
40
40
|
shell_out "bundle install --without development production -j 4", 'Installing ruby gems ...'
|
|
@@ -57,7 +57,7 @@ class HuginnAgent
|
|
|
57
57
|
def shell_out(command, message = nil, streaming_output = false)
|
|
58
58
|
print message if message
|
|
59
59
|
|
|
60
|
-
(status, output) = Bundler.
|
|
60
|
+
(status, output) = Bundler.with_unbundled_env do
|
|
61
61
|
ENV['ADDITIONAL_GEMS'] = "#{gem_name}(path: ../../)"
|
|
62
62
|
ENV['RAILS_ENV'] = 'test'
|
|
63
63
|
if streaming_output
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
require 'huginn_agent'
|
|
2
2
|
|
|
3
|
+
# Allow to add views, controller, routes, etc...
|
|
4
|
+
class Engine < ::Rails::Engine; end
|
|
5
|
+
|
|
3
6
|
#HuginnAgent.load '<%= config[:gem_name] %>/concerns/my_agent_concern'
|
|
4
7
|
HuginnAgent.register '<%= config[:gem_name] %>/<%= config[:agent_file_name] %>'
|
data/lib/huginn_agent/version.rb
CHANGED
data/lib/huginn_agent.rb
CHANGED
|
@@ -6,7 +6,7 @@ class HuginnAgent
|
|
|
6
6
|
|
|
7
7
|
def load_tasks(options = {})
|
|
8
8
|
@branch = options[:branch] || 'master'
|
|
9
|
-
@remote = options[:remote] || 'https://github.com/
|
|
9
|
+
@remote = options[:remote] || 'https://github.com/huginn/huginn.git'
|
|
10
10
|
Rake.add_rakelib File.join(File.expand_path('../', __FILE__), 'tasks')
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -27,7 +27,7 @@ class HuginnAgent
|
|
|
27
27
|
require path
|
|
28
28
|
end
|
|
29
29
|
agent_paths.each do |path|
|
|
30
|
-
|
|
30
|
+
setup_zeitwerk_loader path
|
|
31
31
|
Agent::TYPES << "Agents::#{File.basename(path.to_s).camelize}"
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -41,5 +41,17 @@ class HuginnAgent
|
|
|
41
41
|
def agent_paths
|
|
42
42
|
@agent_paths ||= []
|
|
43
43
|
end
|
|
44
|
+
|
|
45
|
+
def setup_zeitwerk_loader(gem_path)
|
|
46
|
+
gem, _, mod_path = gem_path.partition('/')
|
|
47
|
+
gemspec = Gem::Specification.find_by_name(gem)
|
|
48
|
+
gem_dir = Pathname.new(gemspec.gem_dir)
|
|
49
|
+
module_dir = gem_dir + gemspec.require_paths[0] + gem
|
|
50
|
+
|
|
51
|
+
loader = Zeitwerk::Loader.new
|
|
52
|
+
loader.tag = gem
|
|
53
|
+
loader.push_dir(module_dir, namespace: Agents)
|
|
54
|
+
loader.setup
|
|
55
|
+
end
|
|
44
56
|
end
|
|
45
57
|
end
|
|
@@ -18,8 +18,8 @@ describe HuginnAgent::CLI::New do
|
|
|
18
18
|
expect(cli).to receive(:yes?).with(HuginnAgent::CLI::New::PREFIX_QUESTION) { true }
|
|
19
19
|
expect(cli).to receive(:yes?).with(HuginnAgent::CLI::New::MIT_QUESTION) { true }
|
|
20
20
|
capture(:stdout) { cli.new('test') }
|
|
21
|
-
expect(File.
|
|
22
|
-
expect(File.
|
|
21
|
+
expect(File.exist?(File.join(sandbox, 'huginn_test'))).to be_truthy
|
|
22
|
+
expect(File.exist?(File.join(sandbox, 'huginn_test', 'LICENSE.txt'))).to be_truthy
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
it "does not prefix the gem name and does notcopies the MIT license when told" do
|
|
@@ -27,9 +27,9 @@ describe HuginnAgent::CLI::New do
|
|
|
27
27
|
expect(cli).to receive(:yes?).with(HuginnAgent::CLI::New::MIT_QUESTION) { false }
|
|
28
28
|
|
|
29
29
|
capture(:stdout) { cli.new('test') }
|
|
30
|
-
expect(File.
|
|
31
|
-
expect(File.
|
|
32
|
-
expect(File.
|
|
30
|
+
expect(File.exist?(File.join(sandbox, 'huginn_test'))).to be_falsy
|
|
31
|
+
expect(File.exist?(File.join(sandbox, 'test'))).to be_truthy
|
|
32
|
+
expect(File.exist?(File.join(sandbox, 'test', 'LICENSE.txt'))).to be_falsy
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
it "asks to use a .env file" do
|
|
@@ -39,8 +39,8 @@ describe HuginnAgent::CLI::New do
|
|
|
39
39
|
FileUtils.touch('.env')
|
|
40
40
|
capture(:stdout) { cli.new('test') }
|
|
41
41
|
FileUtils.rm('.env')
|
|
42
|
-
expect(File.
|
|
43
|
-
expect(File.
|
|
44
|
-
expect(File.
|
|
42
|
+
expect(File.exist?(File.join(sandbox, 'huginn_test'))).to be_falsy
|
|
43
|
+
expect(File.exist?(File.join(sandbox, 'test'))).to be_truthy
|
|
44
|
+
expect(File.exist?(File.join(sandbox, 'test', '.env'))).to be_truthy
|
|
45
45
|
end
|
|
46
46
|
end
|
|
@@ -15,7 +15,7 @@ describe HuginnAgent do
|
|
|
15
15
|
it 'sets default values for branch and remote' do
|
|
16
16
|
HuginnAgent.load_tasks
|
|
17
17
|
expect(HuginnAgent.branch).to eq('master')
|
|
18
|
-
expect(HuginnAgent.remote).to eq('https://github.com/
|
|
18
|
+
expect(HuginnAgent.remote).to eq('https://github.com/huginn/huginn.git')
|
|
19
19
|
end
|
|
20
20
|
|
|
21
21
|
it "sets branch and remote based on the passed options" do
|
|
@@ -37,12 +37,12 @@ describe HuginnAgent do
|
|
|
37
37
|
HuginnAgent.require!
|
|
38
38
|
end
|
|
39
39
|
|
|
40
|
-
it '
|
|
40
|
+
it 'sets up Zeitwerk loader for registered paths and adds the class name to Agent::TYPES' do
|
|
41
41
|
class Agent; TYPES = []; end
|
|
42
|
-
string_double= double('test_agent.rb', camelize: 'TestAgent')
|
|
42
|
+
string_double = double('test_agent.rb', camelize: 'TestAgent')
|
|
43
43
|
expect(File).to receive(:basename).and_return(string_double)
|
|
44
44
|
HuginnAgent.register('/tmp/test_agent.rb')
|
|
45
|
-
expect(HuginnAgent).to receive(:
|
|
45
|
+
expect(HuginnAgent).to receive(:setup_zeitwerk_loader).with('/tmp/test_agent.rb')
|
|
46
46
|
HuginnAgent.require!
|
|
47
47
|
expect(Agent::TYPES).to eq(['Agents::TestAgent'])
|
|
48
48
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: huginn_agent
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.6.
|
|
4
|
+
version: 0.6.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Cantino
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: thor
|
|
@@ -24,34 +23,20 @@ dependencies:
|
|
|
24
23
|
- - ">="
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '0'
|
|
27
|
-
- !ruby/object:Gem::Dependency
|
|
28
|
-
name: bundler
|
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
|
30
|
-
requirements:
|
|
31
|
-
- - "~>"
|
|
32
|
-
- !ruby/object:Gem::Version
|
|
33
|
-
version: '1.7'
|
|
34
|
-
type: :development
|
|
35
|
-
prerelease: false
|
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
-
requirements:
|
|
38
|
-
- - "~>"
|
|
39
|
-
- !ruby/object:Gem::Version
|
|
40
|
-
version: '1.7'
|
|
41
26
|
- !ruby/object:Gem::Dependency
|
|
42
27
|
name: rake
|
|
43
28
|
requirement: !ruby/object:Gem::Requirement
|
|
44
29
|
requirements:
|
|
45
|
-
- - "
|
|
30
|
+
- - ">="
|
|
46
31
|
- !ruby/object:Gem::Version
|
|
47
|
-
version: '
|
|
32
|
+
version: '0'
|
|
48
33
|
type: :development
|
|
49
34
|
prerelease: false
|
|
50
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
36
|
requirements:
|
|
52
|
-
- - "
|
|
37
|
+
- - ">="
|
|
53
38
|
- !ruby/object:Gem::Version
|
|
54
|
-
version: '
|
|
39
|
+
version: '0'
|
|
55
40
|
- !ruby/object:Gem::Dependency
|
|
56
41
|
name: rspec
|
|
57
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -70,45 +55,44 @@ dependencies:
|
|
|
70
55
|
name: simplecov
|
|
71
56
|
requirement: !ruby/object:Gem::Requirement
|
|
72
57
|
requirements:
|
|
73
|
-
- - "
|
|
58
|
+
- - ">="
|
|
74
59
|
- !ruby/object:Gem::Version
|
|
75
|
-
version: 0
|
|
60
|
+
version: '0'
|
|
76
61
|
type: :development
|
|
77
62
|
prerelease: false
|
|
78
63
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
64
|
requirements:
|
|
80
|
-
- - "
|
|
65
|
+
- - ">="
|
|
81
66
|
- !ruby/object:Gem::Version
|
|
82
|
-
version: 0
|
|
67
|
+
version: '0'
|
|
83
68
|
- !ruby/object:Gem::Dependency
|
|
84
69
|
name: guard
|
|
85
70
|
requirement: !ruby/object:Gem::Requirement
|
|
86
71
|
requirements:
|
|
87
|
-
- - "
|
|
72
|
+
- - ">="
|
|
88
73
|
- !ruby/object:Gem::Version
|
|
89
|
-
version:
|
|
74
|
+
version: '0'
|
|
90
75
|
type: :development
|
|
91
76
|
prerelease: false
|
|
92
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
78
|
requirements:
|
|
94
|
-
- - "
|
|
79
|
+
- - ">="
|
|
95
80
|
- !ruby/object:Gem::Version
|
|
96
|
-
version:
|
|
81
|
+
version: '0'
|
|
97
82
|
- !ruby/object:Gem::Dependency
|
|
98
83
|
name: guard-rspec
|
|
99
84
|
requirement: !ruby/object:Gem::Requirement
|
|
100
85
|
requirements:
|
|
101
|
-
- - "
|
|
86
|
+
- - ">="
|
|
102
87
|
- !ruby/object:Gem::Version
|
|
103
|
-
version:
|
|
88
|
+
version: '0'
|
|
104
89
|
type: :development
|
|
105
90
|
prerelease: false
|
|
106
91
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
92
|
requirements:
|
|
108
|
-
- - "
|
|
93
|
+
- - ">="
|
|
109
94
|
- !ruby/object:Gem::Version
|
|
110
|
-
version:
|
|
111
|
-
description:
|
|
95
|
+
version: '0'
|
|
112
96
|
email:
|
|
113
97
|
- cantino@gmail.com
|
|
114
98
|
executables:
|
|
@@ -144,11 +128,10 @@ files:
|
|
|
144
128
|
- spec/lib/huginn_agent/spec_runner_spec.rb
|
|
145
129
|
- spec/lib/huginn_agent_spec.rb
|
|
146
130
|
- spec/spec_helper.rb
|
|
147
|
-
homepage: https://github.com/
|
|
131
|
+
homepage: https://github.com/huginn/huginn
|
|
148
132
|
licenses:
|
|
149
133
|
- MIT
|
|
150
134
|
metadata: {}
|
|
151
|
-
post_install_message:
|
|
152
135
|
rdoc_options: []
|
|
153
136
|
require_paths:
|
|
154
137
|
- lib
|
|
@@ -163,9 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
163
146
|
- !ruby/object:Gem::Version
|
|
164
147
|
version: '0'
|
|
165
148
|
requirements: []
|
|
166
|
-
|
|
167
|
-
rubygems_version: 2.6.13
|
|
168
|
-
signing_key:
|
|
149
|
+
rubygems_version: 4.0.6
|
|
169
150
|
specification_version: 4
|
|
170
151
|
summary: Helpers for making new Huginn Agents
|
|
171
152
|
test_files:
|