huginn_agent 0.6.3 → 0.6.4

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ff01c359c18a7262e7e5ae3e860f4dbf91dc1674e38153f9fdce89697189b823
4
- data.tar.gz: dd76eac597d165beb77930df9eb84d1d179ad5b099d8ab456b0b06d03165960d
3
+ metadata.gz: a40e16107a7ac0b8d0d29861cb4cfbefda5efaba359a32b20e54315bfc298ad4
4
+ data.tar.gz: baed6d68490f6e42e1fafefe0422ec8788a154d47c7c2f58165141a235478f33
5
5
  SHA512:
6
- metadata.gz: f9eeb5262cca23d22c08c07195460d1769b5a324479b2b74db69986ca2b1b1447e19686be9aaef3324209eebcfec8e7561f624e3b68effe43a9d8bc4259e25dc
7
- data.tar.gz: 1903c328c30a797ad0470840c7c82e1c1a89f5e3ad806166a5c922d6183bf3c9bd50074dfbe3a2c38aca48e69a4b5bda9478fc4b243e84235263e9c36c753e08
6
+ metadata.gz: e1e31053c8d1f008099f17eeac1b56fffbb48ea7d1f0fef8524bb616545a68a16a1f602a3cfa78eb3aeab1aa410e1ab47da09463515b13b2edad482ee8e2a8ce
7
+ data.tar.gz: 85dba6e68caf47559e1bf9353ee5e523c33911763fc20611f1edba222db02b45832bbaf38655684bcd39fae6b4eff45361767df895141f241255ad0db0a7a7d6
data/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.6.4] - 2026-04-05
6
+
7
+ ### Changed
8
+
9
+ - Require registered agent files directly
10
+
11
+ ### Fixed
12
+
13
+ - Skip duplicate gems from Huginn when loading development dependencies
14
+
5
15
  ## [0.6.3] - 2026-04-05
6
16
 
7
17
  ### Added
@@ -114,7 +124,8 @@ All notable changes to this project will be documented in this file.
114
124
  - First official and working release
115
125
 
116
126
 
117
- [Unreleased]: https://github.com/huginn/huginn_agent/compare/v0.6.3...HEAD
127
+ [Unreleased]: https://github.com/huginn/huginn_agent/compare/v0.6.4...HEAD
128
+ [0.6.4]: https://github.com/huginn/huginn_agent/compare/v0.6.3...v0.6.4
118
129
  [0.6.3]: https://github.com/huginn/huginn_agent/compare/v0.6.2...v0.6.3
119
130
  [0.6.2]: https://github.com/huginn/huginn_agent/compare/v0.6.1...v0.6.2
120
131
  [0.6.1]: https://github.com/huginn/huginn_agent/compare/v0.6.0...v0.6.1
@@ -7,12 +7,9 @@ class GemfileHelper
7
7
  gemspec = Dir["#{base_path}/*.gemspec"].first
8
8
  previous_gems = Hash[dependencies.map { |dep| [dep.name, dep] }]
9
9
  Gem::Specification.load(gemspec).development_dependencies.each do |args|
10
- previous_gem = previous_gems[args.name]
11
- if previous_gem
12
- abort "Gem #{args.to_s} in #{gemspec} conflicts with huginn/Gemfile" unless previous_gem.match?(args.to_spec)
13
- else
14
- yield args.name, *args.requirements_list
15
- end
10
+ next if previous_gems.key?(args.name)
11
+
12
+ yield args.name, *args.requirements_list
16
13
  end
17
14
  end
18
15
  end
@@ -1,3 +1,3 @@
1
1
  class HuginnAgent
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
data/lib/huginn_agent.rb CHANGED
@@ -27,7 +27,7 @@ class HuginnAgent
27
27
  require path
28
28
  end
29
29
  agent_paths.each do |path|
30
- setup_zeitwerk_loader path
30
+ require path
31
31
  Agent::TYPES << "Agents::#{File.basename(path.to_s).camelize}"
32
32
  end
33
33
  end
@@ -41,17 +41,5 @@ 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
56
44
  end
57
45
  end
@@ -0,0 +1,30 @@
1
+ require 'spec_helper'
2
+ require 'rubygems/dependency'
3
+
4
+ describe 'gemfile_helper patch' do
5
+ let(:patch_path) { File.expand_path('../../../../lib/huginn_agent/patches/gemfile_helper.rb', __dir__) }
6
+ let(:rspec_dependency) { Gem::Dependency.new('rspec', '>= 0') }
7
+ let(:thor_dependency) { Gem::Dependency.new('thor', '~> 1.5') }
8
+ let(:gemspec) { instance_double(Gem::Specification, development_dependencies: [rspec_dependency, thor_dependency]) }
9
+
10
+ let(:context) do
11
+ Object.new.tap do |object|
12
+ object.instance_variable_set(:@dependencies, [Gem::Dependency.new('rspec', '~> 3.13')])
13
+ object.instance_variable_set(:@added_gems, [])
14
+
15
+ object.define_singleton_method(:dependencies) { @dependencies }
16
+ object.define_singleton_method(:gem) { |*args| @added_gems << args }
17
+ object.define_singleton_method(:added_gems) { @added_gems }
18
+ end
19
+ end
20
+
21
+ before do
22
+ allow(Gem::Specification).to receive(:load).and_return(gemspec)
23
+ end
24
+
25
+ it 'does not add development dependencies already present in Huginn' do
26
+ context.instance_eval(File.read(patch_path), patch_path)
27
+
28
+ expect(context.added_gems).to eq([['thor']])
29
+ end
30
+ end
@@ -37,12 +37,12 @@ describe HuginnAgent do
37
37
  HuginnAgent.require!
38
38
  end
39
39
 
40
- it 'sets up Zeitwerk loader for registered paths and adds the class name to Agent::TYPES' do
40
+ it 'requires registered paths and adds the class name to Agent::TYPES' do
41
41
  class Agent; TYPES = []; end
42
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(:setup_zeitwerk_loader).with('/tmp/test_agent.rb')
45
+ expect(HuginnAgent).to receive(:require).with('/tmp/test_agent.rb')
46
46
  HuginnAgent.require!
47
47
  expect(Agent::TYPES).to eq(['Agents::TestAgent'])
48
48
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: huginn_agent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.3
4
+ version: 0.6.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Cantino
@@ -125,6 +125,7 @@ files:
125
125
  - lib/tasks/spec.rake
126
126
  - spec/lib/huginn_agent/cli/new_spec.rb
127
127
  - spec/lib/huginn_agent/helper_spec.rb
128
+ - spec/lib/huginn_agent/patches/gemfile_helper_spec.rb
128
129
  - spec/lib/huginn_agent/spec_runner_spec.rb
129
130
  - spec/lib/huginn_agent_spec.rb
130
131
  - spec/spec_helper.rb
@@ -152,6 +153,7 @@ summary: Helpers for making new Huginn Agents
152
153
  test_files:
153
154
  - spec/lib/huginn_agent/cli/new_spec.rb
154
155
  - spec/lib/huginn_agent/helper_spec.rb
156
+ - spec/lib/huginn_agent/patches/gemfile_helper_spec.rb
155
157
  - spec/lib/huginn_agent/spec_runner_spec.rb
156
158
  - spec/lib/huginn_agent_spec.rb
157
159
  - spec/spec_helper.rb