fedora_lens 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: 65cadbc75268a27e1ca476cd033f2fb7df5d9dd0
4
- data.tar.gz: 5eac3438dced3e625013d9b635e3a8c9b4915f2e
3
+ metadata.gz: 1851950ca061fabd4b2a32c699778accbcbfbce2
4
+ data.tar.gz: d45a09d0ee487eb21fd118acc97a97b9df4d0299
5
5
  SHA512:
6
- metadata.gz: fe8c4ba5b7af3b15a77a447d402aee0b4021fda668068d5a228a88dcb2cecfd13bf2947998d7f8da68bddcce2969f3dbea66158c1d077806c9deb16021e9eefe
7
- data.tar.gz: 9d68f7494ed6e9c609d255d7113439a93f8cef35bdd67111a6735048f7d190b05cda5d11ea35e1ae0f32f081e6845a0d910502a7548403600c44a6cc788f93a5
6
+ metadata.gz: ee264c445d33e8a9637e24c826081525719cc37208159d57d26c70c43994783167fa962eae0485681732eedb583976409ab4bf7c00c0856b68df85454cda4bb3
7
+ data.tar.gz: 14c1c41dbba783f45030c2e0f22f9d12af28596acfd31768deb8dff02953dd69d9dd913de0214b0d05da5d5f0dc3d84185baeb4d73cca63418721ea5d3a3591d
data/lib/fedora_lens.rb CHANGED
@@ -146,7 +146,7 @@ module FedoraLens
146
146
  end
147
147
 
148
148
  def id_to_uri(id)
149
- "#{HOST}#{PATH}#{id}"
149
+ "#{HOST}#{PATH}" + (id.start_with?('/') ? id : '/' + id)
150
150
  end
151
151
 
152
152
  def uri_to_id(uri)
@@ -1,3 +1,3 @@
1
1
  module FedoraLens
2
- VERSION = '0.0.6'
2
+ VERSION = '0.0.7'
3
3
  end
@@ -17,7 +17,7 @@ describe FedoraLens do
17
17
  # end
18
18
 
19
19
 
20
- describe "context with a simple class" do
20
+ context "with a simple class" do
21
21
  before do
22
22
  class TestClass
23
23
  include FedoraLens
@@ -107,6 +107,19 @@ describe FedoraLens do
107
107
 
108
108
  end
109
109
  end
110
+
111
+ describe "id_to_uri" do
112
+ subject { TestClass.id_to_uri(id) }
113
+ context "without a leading slash" do
114
+ let(:id) { 'test' }
115
+ it { should eq 'http://localhost:8983/fedora/rest/test' }
116
+ end
117
+ context "with a leading slash" do
118
+ let(:id) { '/test' }
119
+ it { should eq 'http://localhost:8983/fedora/rest/test' }
120
+ end
121
+ end
122
+
110
123
  end
111
124
 
112
125
  context "with a class that has many attributes" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fedora_lens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne