Skip to content

Commit

Permalink
Revert "Release 0.6.0: Remove leading components from IDs"
Browse files Browse the repository at this point in the history
  • Loading branch information
tmtmtmtm committed Aug 27, 2016
1 parent 5e61c2f commit 74db016
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 21 deletions.
13 changes: 1 addition & 12 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [0.6.0] - 2016-08-27

### Changed

- the `id` for an Entity will now strip any prefix (e.g. "party/abc"
will now be simply "abc")

## [0.5.0] - 2016-08-01

### Added
Expand Down Expand Up @@ -59,8 +52,4 @@ This project adheres to [Semantic Versioning](http://semver.org/).

[0.2.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.1.0...v0.2.0
[0.3.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.2.0...v0.3.0
[0.3.1]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.3.0...v0.3.1
[0.3.2]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.3.1...v0.3.2
[0.4.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.3.0...v0.4.0
[0.5.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.4.0...v0.5.0
[0.6.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.5.0...v0.6.0
[0.3.0]: https://github.com/everypolitician/everypolitician-popolo/compare/v0.3.0...v0.3.1
6 changes: 1 addition & 5 deletions lib/everypolitician/popolo/entity.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Everypolitician
module Popolo
class Entity
attr_writer :id
attr_accessor :id
attr_reader :document
attr_reader :popolo

Expand Down Expand Up @@ -31,10 +31,6 @@ def ==(other)
end
alias eql? ==

def id
@id.to_s.split('/').last
end

def identifier(scheme)
identifiers.find(-> { {} }) { |i| i[:scheme] == scheme }[:identifier]
end
Expand Down
2 changes: 1 addition & 1 deletion lib/everypolitician/popolo/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Everypolitician
module Popolo
VERSION = '0.6.0'.freeze
VERSION = '0.5.0'.freeze
end
end
2 changes: 1 addition & 1 deletion test/everypolitician/popolo/event_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def test_accessing_event_properties
)
event = popolo.events.first

assert_equal '8', event.id
assert_equal 'term/8', event.id
assert_equal '8th Verkhovna Rada', event.name
assert_equal '2014-11-27', event.start_date
assert_nil event.end_date
Expand Down
2 changes: 1 addition & 1 deletion test/everypolitician/popolo/organization_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_accessing_organization_properties
end

def test_organization_equality_based_on_id
org1 = Everypolitician::Popolo::Organization.new(id: 'org/abc', name: 'ACME')
org1 = Everypolitician::Popolo::Organization.new(id: 'abc', name: 'ACME')
org2 = Everypolitician::Popolo::Organization.new(id: 'abc', name: 'ACME')
assert_equal org1, org2
end
Expand Down
2 changes: 1 addition & 1 deletion test/everypolitician/popolo_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_reading_file
popolo = Everypolitician::Popolo.read('test/fixtures/ep-popolo-v1.0.json')
assert_equal 1, popolo.persons.count
person = popolo.persons.first
assert_equal '123', person.id
assert_equal 'person/123', person.id
assert_equal 'Bob Smith', person.name
end
end

0 comments on commit 74db016

Please sign in to comment.