···3- added YARD documentation
4- added explicit `base64` dependency in gemspec
5- added `MAX_LIMIT` (100) and `DEFAULT_LIMIT` (50) constants
06- removed deprecated options `enable_unsafe_auth` and `validate_responses`
7- fixed `rake:publish` not working with feed `description` is nil (thx @jthigpen)
8- `rake:publish` shows a better error message when `createSession` requires a 2FA token
···3- added YARD documentation
4- added explicit `base64` dependency in gemspec
5- added `MAX_LIMIT` (100) and `DEFAULT_LIMIT` (50) constants
6+- removed the length limit on feed rkeys, since it isn't actually limited to 15
7- removed deprecated options `enable_unsafe_auth` and `validate_responses`
8- fixed `rake:publish` not working with feed `description` is nil (thx @jthigpen)
9- `rake:publish` shows a better error message when `createSession` requires a 2FA token
+1-1
README.md
···29- `publisher_did` – DID identifier of the account that you will publish the feed on (the string that starts with `did:plc:...`)
30- `hostname` – the hostname on which the feed service will be run
3132-You also need to configure at least one feed by passing a feed key and a feed object. The key is the identifier (rkey) that will appear at the end of the feed URI – it must only contain characters that are valid in URLs (preferably all lowercase) and it can't be longer than 15 characters. The feed object is anything that implements the single required method `get_posts` (could be a class, a module or an instance).
3334So a simple setup could look like this:
35
···29- `publisher_did` – DID identifier of the account that you will publish the feed on (the string that starts with `did:plc:...`)
30- `hostname` – the hostname on which the feed service will be run
3132+You also need to configure at least one feed by passing a feed key and a feed object. The key is the identifier (rkey) that will appear at the end of the feed URI – it must only contain characters that are valid in URLs (preferably all lowercase) and it should be rather short. The feed object is anything that implements the single required method `get_posts` (could be a class, a module or an instance).
3334So a simple setup could look like this:
35
-1
lib/blue_factory/modules/feeds.rb
···76 def validate_key(key)
77 raise ConfigurationError, "Key must be a string (got: #{key.inspect})" unless key.is_a?(String)
78 raise ConfigurationError, "Key must not be empty" if key == ''
79- raise ConfigurationError, "Key must not be longer than 15 characters (got: #{key.inspect})" if key.length > 15
80 raise ConfigurationError, "Key #{key.inspect} contains invalid characters" if key !~ RKEY_REGEXP
81 end
82
···76 def validate_key(key)
77 raise ConfigurationError, "Key must be a string (got: #{key.inspect})" unless key.is_a?(String)
78 raise ConfigurationError, "Key must not be empty" if key == ''
079 raise ConfigurationError, "Key #{key.inspect} contains invalid characters" if key !~ RKEY_REGEXP
80 end
81
+6-1
spec/feeds_spec.rb
···34 { blue: true },
35 ['a', 'b'],
36 '',
37- 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch',
38 'blue sky',
39 'gnu/linux',
40 'ohno!',
···45 bad_keys.each do |key|
46 expect { BlueFactory.add_feed(key, TestFeed.new) }.to raise_error(BlueFactory::ConfigurationError)
47 end
00000048 end
4950 it "should raise an error when the feed doesn't have a get_posts method" do
···34 { blue: true },
35 ['a', 'b'],
36 '',
037 'blue sky',
38 'gnu/linux',
39 'ohno!',
···44 bad_keys.each do |key|
45 expect { BlueFactory.add_feed(key, TestFeed.new) }.to raise_error(BlueFactory::ConfigurationError)
46 end
47+ end
48+49+ it 'should not raise an error for very long keys' do
50+ name = 'Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch'
51+52+ expect { BlueFactory.add_feed(name, TestFeed.new) }.to_not raise_error
53 end
5455 it "should raise an error when the feed doesn't have a get_posts method" do