hydramata-works 0.0.1.prerelease

Sign up to get free protection for your applications and to get access to all the features.
Files changed (188) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +15 -0
  3. data/.hound.yml +818 -0
  4. data/.rspec +2 -0
  5. data/.travis.yml +20 -0
  6. data/CONTRIBUTING.md +220 -0
  7. data/Gemfile +36 -0
  8. data/Guardfile +36 -0
  9. data/LICENSE +15 -0
  10. data/README.md +36 -0
  11. data/Rakefile +47 -0
  12. data/TODO.md +74 -0
  13. data/VISION.md +19 -0
  14. data/app/forms/hydramata/works/entity_form.rb +92 -0
  15. data/app/forms/hydramata/works/validation_service.rb +78 -0
  16. data/app/models/hydramata/works/data_definition.rb +57 -0
  17. data/app/models/hydramata/works/entities.rb +11 -0
  18. data/app/models/hydramata/works/entity.rb +75 -0
  19. data/app/models/hydramata/works/predicate.rb +35 -0
  20. data/app/models/hydramata/works/predicate_presentation_sequences/storage.rb +29 -0
  21. data/app/models/hydramata/works/predicate_set.rb +44 -0
  22. data/app/models/hydramata/works/predicate_sets/storage.rb +45 -0
  23. data/app/models/hydramata/works/predicates.rb +14 -0
  24. data/app/models/hydramata/works/predicates/storage.rb +33 -0
  25. data/app/models/hydramata/works/presentation_structure.rb +29 -0
  26. data/app/models/hydramata/works/property.rb +72 -0
  27. data/app/models/hydramata/works/property_set.rb +89 -0
  28. data/app/models/hydramata/works/validations.rb +6 -0
  29. data/app/models/hydramata/works/value.rb +34 -0
  30. data/app/models/hydramata/works/work_type.rb +49 -0
  31. data/app/models/hydramata/works/work_types.rb +14 -0
  32. data/app/models/hydramata/works/work_types/storage.rb +42 -0
  33. data/app/parsers/hydramata/works/datastream_parser.rb +36 -0
  34. data/app/parsers/hydramata/works/datastream_parsers/rdf_ntriples_parser.rb +60 -0
  35. data/app/parsers/hydramata/works/datastream_parsers/simple_xml_parser.rb +27 -0
  36. data/app/parsers/hydramata/works/predicate_parser.rb +31 -0
  37. data/app/parsers/hydramata/works/predicate_parsers/simple_parser.rb +13 -0
  38. data/app/parsers/hydramata/works/validations_parser.rb +22 -0
  39. data/app/parsers/hydramata/works/value_parser.rb +26 -0
  40. data/app/parsers/hydramata/works/value_parsers.rb +27 -0
  41. data/app/parsers/hydramata/works/value_parsers/date_parser.rb +13 -0
  42. data/app/parsers/hydramata/works/value_parsers/interrogation_parser.rb +18 -0
  43. data/app/parsers/hydramata/works/value_parsers/simple_parser.rb +14 -0
  44. data/app/presenters/hydramata/works/base_presenter.rb +146 -0
  45. data/app/presenters/hydramata/works/dom_attributes_builder.rb +24 -0
  46. data/app/presenters/hydramata/works/entity_presenter.rb +67 -0
  47. data/app/presenters/hydramata/works/fieldset_presenter.rb +54 -0
  48. data/app/presenters/hydramata/works/property_presenter.rb +51 -0
  49. data/app/presenters/hydramata/works/value_presenter.rb +60 -0
  50. data/app/renderers/hydramata/works/entity_renderer.rb +45 -0
  51. data/app/views/hydramata/works/fieldsets/_edit.html.erb +4 -0
  52. data/app/views/hydramata/works/fieldsets/_show.html.erb +8 -0
  53. data/app/views/hydramata/works/fieldsets/_show.json.jbuilder +8 -0
  54. data/app/views/hydramata/works/properties/_edit.html.erb +12 -0
  55. data/app/views/hydramata/works/properties/_show.html.erb +3 -0
  56. data/app/views/hydramata/works/properties/_show.json.jbuilder +1 -0
  57. data/app/views/hydramata/works/works/_edit.html.erb +8 -0
  58. data/app/views/hydramata/works/works/_new.html.erb +8 -0
  59. data/app/views/hydramata/works/works/_show.html.erb +3 -0
  60. data/app/views/hydramata/works/works/_show.json.jbuilder +13 -0
  61. data/app/wranglers/hydramata/works/fedora_wrangler.rb +66 -0
  62. data/bin/rails +12 -0
  63. data/db/migrate/20140606132349_create_hydramata_work_predicates.rb +13 -0
  64. data/db/migrate/20140606132350_create_hydramata_work_types.rb +9 -0
  65. data/db/migrate/20140606132351_create_hydramata_work_predicate_sets.rb +13 -0
  66. data/db/migrate/20140606132352_create_hydramata_work_predicate_presentation_sequences.rb +12 -0
  67. data/db/migrate/20140623200635_add_validations_to_predicates.rb +5 -0
  68. data/db/migrate/20140627134133_adding_item_type_schema_dot_org_to_work_type.rb +5 -0
  69. data/db/migrate/20140627140840_adding_item_prop_schema_dot_org_to_predicate.rb +5 -0
  70. data/db/seeds.rb +36 -0
  71. data/documents/administrative-set-strawperson.md +45 -0
  72. data/documents/diagrams/hydramata-refactor-tasks.dot +88 -0
  73. data/documents/diagrams/hydramata-sip-dip-aip.dot +88 -0
  74. data/documents/diagrams/hydramata-work-architecture.dot +129 -0
  75. data/documents/diagrams/hydramata-work-subcomponents.dot +36 -0
  76. data/documents/diagrams/map-from-database-to-work-object.dot +44 -0
  77. data/documents/diagrams/map-from-fedora-to-work-object.dot +51 -0
  78. data/documents/diagrams/map-from-input-to-work-object.dot +37 -0
  79. data/documents/diagrams/map-from-work-object-to-database.dot +31 -0
  80. data/documents/diagrams/work-rendering.dot +53 -0
  81. data/documents/diagrams/work-structure.dot +32 -0
  82. data/documents/handling-work.md +224 -0
  83. data/documents/high-level-stories.md +105 -0
  84. data/documents/hydramata-components.md +82 -0
  85. data/documents/interface-between-work-and-permissions.md +131 -0
  86. data/documents/interface-between-work-and-workflow.md +6 -0
  87. data/documents/timeline.md +75 -0
  88. data/fs +3 -0
  89. data/gemfiles/rails4.1.gemfile +12 -0
  90. data/gemfiles/rails4.gemfile +13 -0
  91. data/hydramata-works.gemspec +43 -0
  92. data/lib/hydramata-works.rb +23 -0
  93. data/lib/hydramata/works/conversions.rb +21 -0
  94. data/lib/hydramata/works/conversions/exceptions.rb +18 -0
  95. data/lib/hydramata/works/conversions/predicate.rb +22 -0
  96. data/lib/hydramata/works/conversions/predicate_set.rb +28 -0
  97. data/lib/hydramata/works/conversions/presented_fieldsets.rb +28 -0
  98. data/lib/hydramata/works/conversions/presenter.rb +13 -0
  99. data/lib/hydramata/works/conversions/property.rb +31 -0
  100. data/lib/hydramata/works/conversions/property_set.rb +23 -0
  101. data/lib/hydramata/works/conversions/translation_key_fragment.rb +20 -0
  102. data/lib/hydramata/works/conversions/value.rb +20 -0
  103. data/lib/hydramata/works/conversions/work_type.rb +26 -0
  104. data/lib/hydramata/works/engine.rb +31 -0
  105. data/lib/hydramata/works/linters.rb +99 -0
  106. data/lib/hydramata/works/linters/implement_data_definition_interface_matcher.rb +17 -0
  107. data/lib/hydramata/works/linters/implement_entity_interface_matcher.rb +16 -0
  108. data/lib/hydramata/works/linters/implement_predicate_interface_matcher.rb +17 -0
  109. data/lib/hydramata/works/linters/implement_predicate_set_interface_matcher.rb +8 -0
  110. data/lib/hydramata/works/linters/implement_property_set_interface_matcher.rb +8 -0
  111. data/lib/hydramata/works/linters/implement_value_interface_matcher.rb +8 -0
  112. data/lib/hydramata/works/linters/implement_work_type_interface_matcher.rb +13 -0
  113. data/lib/hydramata/works/linters/interface_matcher_builder.rb +36 -0
  114. data/lib/hydramata/works/translator.rb +67 -0
  115. data/lib/hydramata/works/version.rb +5 -0
  116. data/lib/hydramata_works.rb +2 -0
  117. data/lib/tasks/hydramata_work_tasks.rake +4 -0
  118. data/run_each_spec_in_isolation +16 -0
  119. data/run_each_spec_in_isolation.txt +110 -0
  120. data/script/analyzer.rb +124 -0
  121. data/script/fast_specs +22 -0
  122. data/spec/features/fedora_to_in_memory_spec.rb +60 -0
  123. data/spec/features/format_and_view_path_overrides_spec.rb +72 -0
  124. data/spec/features/in_memory_to_output_buffer_spec.rb +109 -0
  125. data/spec/features/instantiate_entity_from_persisted_work_type_spec.rb +26 -0
  126. data/spec/features/new_user_input_to_in_memory_spec.rb +75 -0
  127. data/spec/features/translation_services_spec.rb +107 -0
  128. data/spec/features/validate_entity_based_on_work_type_structure_spec.rb +19 -0
  129. data/spec/fixtures/cassettes/fedora-object.yml +299 -0
  130. data/spec/fixtures/translations.yml +20 -0
  131. data/spec/forms/hydramata/works/entity_form_spec.rb +83 -0
  132. data/spec/forms/hydramata/works/validation_service_spec.rb +32 -0
  133. data/spec/lib/hydramata-work_spec.rb +14 -0
  134. data/spec/lib/hydramata/works/conversions/predicate_set_spec.rb +50 -0
  135. data/spec/lib/hydramata/works/conversions/predicate_spec.rb +43 -0
  136. data/spec/lib/hydramata/works/conversions/presented_fieldsets_spec.rb +52 -0
  137. data/spec/lib/hydramata/works/conversions/presenter_spec.rb +22 -0
  138. data/spec/lib/hydramata/works/conversions/property_set_spec.rb +42 -0
  139. data/spec/lib/hydramata/works/conversions/property_spec.rb +68 -0
  140. data/spec/lib/hydramata/works/conversions/translation_key_fragment_spec.rb +45 -0
  141. data/spec/lib/hydramata/works/conversions/value_spec.rb +36 -0
  142. data/spec/lib/hydramata/works/conversions/work_type_spec.rb +55 -0
  143. data/spec/lib/hydramata/works/translator_spec.rb +81 -0
  144. data/spec/models/hydramata/works/data_definition_spec.rb +53 -0
  145. data/spec/models/hydramata/works/entity_spec.rb +50 -0
  146. data/spec/models/hydramata/works/predicate_presentation_sequences/storage_spec.rb +15 -0
  147. data/spec/models/hydramata/works/predicate_set_spec.rb +63 -0
  148. data/spec/models/hydramata/works/predicate_sets/storage_spec.rb +37 -0
  149. data/spec/models/hydramata/works/predicate_spec.rb +16 -0
  150. data/spec/models/hydramata/works/predicates/storage_spec.rb +78 -0
  151. data/spec/models/hydramata/works/predicates_spec.rb +18 -0
  152. data/spec/models/hydramata/works/presentation_structure_spec.rb +27 -0
  153. data/spec/models/hydramata/works/property_set_spec.rb +135 -0
  154. data/spec/models/hydramata/works/property_spec.rb +74 -0
  155. data/spec/models/hydramata/works/value_spec.rb +61 -0
  156. data/spec/models/hydramata/works/work_type_spec.rb +45 -0
  157. data/spec/models/hydramata/works/work_types/storage_spec.rb +74 -0
  158. data/spec/models/hydramata/works/work_types_spec.rb +16 -0
  159. data/spec/parsers/hydramata/works/datastream_parser_spec.rb +29 -0
  160. data/spec/parsers/hydramata/works/datastream_parsers/rdf_ntriples_parser_spec.rb +65 -0
  161. data/spec/parsers/hydramata/works/datastream_parsers/simple_xml_parser_spec.rb +37 -0
  162. data/spec/parsers/hydramata/works/predicate_parser_spec.rb +30 -0
  163. data/spec/parsers/hydramata/works/predicate_parsers/simple_parser_spec.rb +20 -0
  164. data/spec/parsers/hydramata/works/validations_parser_spec.rb +31 -0
  165. data/spec/parsers/hydramata/works/value_parser_spec.rb +22 -0
  166. data/spec/parsers/hydramata/works/value_parsers/simple_parser_spec.rb +20 -0
  167. data/spec/parsers/hydramata/works/value_parsers_spec.rb +36 -0
  168. data/spec/presenters/hydramata/works/base_presenter_spec.rb +111 -0
  169. data/spec/presenters/hydramata/works/dom_attributes_builder_spec.rb +26 -0
  170. data/spec/presenters/hydramata/works/entity_presenter_spec.rb +51 -0
  171. data/spec/presenters/hydramata/works/fieldset_presenter_spec.rb +58 -0
  172. data/spec/presenters/hydramata/works/property_presenter_spec.rb +42 -0
  173. data/spec/presenters/hydramata/works/value_presenter_spec.rb +49 -0
  174. data/spec/renderers/hydramata/works/entity_renderer_spec.rb +25 -0
  175. data/spec/spec_active_record_helper.rb +30 -0
  176. data/spec/spec_fast_helper.rb +12 -0
  177. data/spec/spec_slow_helper.rb +56 -0
  178. data/spec/spec_view_helper.rb +14 -0
  179. data/spec/test_app_templates/lib/generators/test_app_generator.rb +21 -0
  180. data/spec/views/hydramata/works/fieldsets/_edit.html.erb_spec.rb +29 -0
  181. data/spec/views/hydramata/works/fieldsets/_show.html.erb_spec.rb +25 -0
  182. data/spec/views/hydramata/works/properties/_edit.html.erb_spec.rb +22 -0
  183. data/spec/views/hydramata/works/properties/_show.html.erb_spec.rb +22 -0
  184. data/spec/views/hydramata/works/works/_edit.html.erb_spec.rb +23 -0
  185. data/spec/views/hydramata/works/works/_new.html.erb_spec.rb +23 -0
  186. data/spec/views/hydramata/works/works/_show.html.erb_spec.rb +24 -0
  187. data/spec/wranglers/hydramata/works/fedora_wrangler_spec.rb +26 -0
  188. metadata +466 -0
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --color
2
+ --format progress
@@ -0,0 +1,20 @@
1
+ language: ruby
2
+ rvm:
3
+ - "2.0.0"
4
+ - "2.1.1"
5
+ - "2.1.2"
6
+
7
+ gemfile:
8
+ - gemfiles/rails4.gemfile
9
+ - gemfiles/rails4.1.gemfile
10
+
11
+ env:
12
+ global:
13
+ - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
14
+
15
+ script: 'COVERAGE=true rake spec:travis'
16
+
17
+ bundler_args: --without headless debug
18
+
19
+ before_install:
20
+ - gem install bundler
@@ -0,0 +1,220 @@
1
+ We want your help to make our project great.
2
+ There are a few guidelines that we need contributors to follow so that we can have a chance of keeping on top of things.
3
+
4
+ * [The Hydra Way](#the-hydra-way)
5
+ * [Reporting Issues](#reporting-issues)
6
+ * [What is a well written issue?](#what-is-a-well-written-issue)
7
+ * [Making Changes](#making-changes)
8
+ * [Where to Engage for Help](#where-to-engage-for-help)
9
+ * [Submitting Changes](#submitting-changes)
10
+ * [Contributor License Agreement](#contributor-license-agreement)
11
+ * [Coding Guidelines](#coding-guidelines)
12
+ * [Writing Your Specs](#writing-your-specs)
13
+ * [Custom Rspec Matchers](#custom-rspec-matchers)
14
+ * [Writing Your Code](#writing-your-code)
15
+ * [Ruby File Structure](#ruby-file-structure)
16
+ * [Well Written Commit Messages](#well-written-commit-messages)
17
+ * [Reviewing Changes](#reviewing-changes)
18
+ * [Responsibilities of a Reviewer](#responsibilities-of-a-reviewer)
19
+ * [Responsibilities of the Submitter](#responsibilities-of-the-submitter)
20
+ * [Merging Changes](#merging-changes)
21
+
22
+ # The Hydra Way
23
+
24
+ We strive to…
25
+
26
+ * Provide a [harassment-free community experience](https://wiki.duraspace.org/display/hydra/Anti-Harassment+Policy)
27
+ * Adhere to our [Hierarchy of Promises](https://wiki.duraspace.org/display/hydra/Hydra+Stack+-+The+Hierarchy+of+Promises)
28
+ * Operate under [Lazy Consensus](http://rave.apache.org/docs/governance/lazyConsensus.html)
29
+ * Encourage community participation as guided by [our community principles](https://wiki.duraspace.org/display/hydra/Hydra+Community+Principles)
30
+
31
+ # Reporting Issues
32
+
33
+ Submit a [well written issue](#what-is-a-well-written-issue) to [Github's issue tracker](./issues).
34
+ This will require a [GitHub account](https://github.com/signup/free) *(its free)*.
35
+
36
+ ## What is a well written issue?
37
+
38
+ * Provide a descriptive summary
39
+ * Reference the gem version in which you encountered the problem
40
+ * Explain the expected behavior
41
+ * Explain the actual behavior
42
+ * Provide steps to reproduce the actual behavior
43
+
44
+ # Submitting Changes
45
+
46
+ ## Contributor License Agreement
47
+
48
+ **Note: You can submit a pull request before you've signed the Contributor License Agreement, but we won't merge your changes until we have your CLA on file.**
49
+
50
+ Before any [ProjectHydra project](https://github.com/projecthydra) can accept your contributions we must have a [Contributor License Agreement on file](https://wiki.duraspace.org/display/hydra/Hydra+Project+Intellectual+Property+Licensing+and+Ownership).
51
+
52
+ All code contributors must have an Individual Contributor License Agreement (iCLA) on file with the Hydra Project Steering Group.
53
+ If the contributor works for an institution, the institution must have a Corporate Contributor License Agreement (cCLA) on file.
54
+
55
+ [More on the Contributor License Agreements](https://wiki.duraspace.org/display/hydra/Hydra+Project+Intellectual+Property+Licensing+and+Ownership)
56
+
57
+ ## Coding Guidelines
58
+
59
+ This project is using [HoundCI](https://houndci.com) to help support our agreed upon style guide.
60
+ The style guide is a work in progress, and is declared in the project's `./hound.yml` file.
61
+
62
+ Hound is a Github integration tool that essentially runs [rubocop](http://rubygems.org/gems/rubocop).
63
+
64
+ > Automatic Ruby code style checking tool. Aims to enforce the community-driven Ruby Style Guide.
65
+
66
+ If you want to run `rubocop` with our style guide, first `gem install rubocop` then inside the project:
67
+
68
+ ```bash
69
+ $ rubocop ./path/to/file ./or/path/to/directory -c ./.hound.yml
70
+ ```
71
+ **Can I break these guidelines?** Yes. But you may need to convince the person merging your changes.
72
+
73
+ ### Writing Your Specs
74
+
75
+ Your code changes should include support tests.
76
+
77
+ Before you begin writing code, think about the test that will verify the code you plan to write.
78
+ A [well written story with Gherkin syntax](http://pivotallabs.com/well-formed-stories/) can help formulate the pre-conditions (Given), invocation (When), and post-conditions (Then).
79
+
80
+ *This is the first step of Test Driven Development, and something that we strongly encourage.*
81
+
82
+ Now write that test; It should be your guidepost for any changes you plan on making.
83
+ Ideally the test you just wrote will be executable code.
84
+ However, a well formed Gherkin-syntax story is a suitable proxy; Especially if you are uncomfortable with where to put the executable code.
85
+
86
+ *Think of your written test as a statement of intent.*
87
+ *The statement of intent can then be used when asking for help or clarity; Either from another developer or a stakeholder.*
88
+ *Someone helping you can then see both what you are trying to do and how you are doing it; And that helper may know of a "better" way to do it.*
89
+
90
+ #### Custom Rspec Matchers
91
+
92
+ We encourage the use of [custom rspec matchers](https://www.relishapp.com/rspec/rspec-expectations/v/2-3/docs/custom-matchers/define-matcher) as this helps our specs better convey what is going on.
93
+
94
+ To find the existing Rspec matchers in this project, you can run `rake yenta`.
95
+ Below is the sample output.
96
+
97
+ ```shell
98
+ be /path/to/bundled/gem/rspec-expectations-2.14.4/lib/rspec/matchers.rb:221
99
+ be_a /path/to/bundled/gem/rspec-expectations-2.14.4/lib/rspec/matchers.rb:227
100
+ be_a_kind_of /path/to/bundled/gem/rspec-expectations-2.14.4/lib/rspec/matchers.rb:253
101
+ be_a_new /path/to/bundled/gem/rspec-rails-2.14.0/lib/rspec/rails/matchers/be_a_new.rb:73
102
+ be_an /path/to/bundled/gem/rspec-expectations-2.14.4/lib/rspec/matchers.rb:227
103
+ be_an_instance_of /path/to/bundled/gem/rspec-expectations-2.14.4/lib/rspec/matchers.rb:240
104
+ ...
105
+ ```
106
+
107
+ ### Writing Your Code
108
+
109
+ We are going to do our best to follow [Sandi Metz' Rules for Developers](http://robots.thoughtbot.com/post/50655960596/sandi-metz-rules-for-developers)
110
+
111
+ > Here are the rules:
112
+ >
113
+ > * Classes can be no longer than one hundred lines of code.
114
+ > * Methods can be no longer than five lines of code.
115
+ > * Pass no more than four parameters into a method. Hash options are parameters.
116
+ > * Controllers can instantiate only one object. Therefore, views can only know about one instance variable and views should only send messages to that object (@object.collaborator.value is not allowed).
117
+
118
+ ### Ruby File Structure
119
+
120
+ * Use soft-tabs with a two space indent.
121
+ * Never leave trailing whitespace (unless it is meaningful in the language)
122
+ * End each file with a blank newline.
123
+ * Please do your best to keep lines to 80 characters or fewer.
124
+
125
+ ## Well Written Commit Messages
126
+
127
+ **TL;DR**
128
+
129
+ * First line is < 50 characters
130
+ * The message body explains what the code changes are about
131
+ * Reference any JIRA or Github issues on new lines.
132
+
133
+ ### Terse Example
134
+
135
+ ```
136
+ Removing Document title validation
137
+
138
+ We thought we wanted title validation but that was too complicated.
139
+
140
+ HYDRASIR-12 #close
141
+ ```
142
+
143
+ ### Verbose Example
144
+
145
+ ```
146
+ Present tense short summary (50 characters or less)
147
+
148
+ More detailed description, if necessary. It should be wrapped to 72
149
+ characters. Try to be as descriptive as you can, even if you think that
150
+ the commit content is obvious, it may not be obvious to others. You
151
+ should add such description also if it's already present in bug tracker,
152
+ it should not be necessary to visit a webpage to check the history.
153
+
154
+ Description can have multiple paragraphs and you can use code examples
155
+ inside, just indent it with 4 spaces:
156
+
157
+ class PostsController
158
+ def index
159
+ respond_with Post.limit(10)
160
+ end
161
+ end
162
+
163
+ You can also add bullet points:
164
+
165
+ - you can use dashes or asterisks
166
+
167
+ - also, try to indent next line of a point for readability, if it's too
168
+ long to fit in 72 characters
169
+ ```
170
+
171
+ > When appropriate, please squash your commits into logical units of work.
172
+ > This simplifies future cherry picks, and also keeps the git log clean.
173
+
174
+ ### Hooks into other Subsystems
175
+
176
+ **[log skip]**: If your commit is not relevant to a change log, you can add `[log skip]` to your commit message.
177
+ Relevance is subjective, though extremely minor changes need not be part of the change log (i.e. spelling correction, decomposing a private method into multiple private methods, etc.)
178
+
179
+ **[ci skip]**: If your commit does not need to go through the Continuous Integration server, add `[ci skip]` to your commit message.
180
+ This is typically used for updates to the documentation and stylesheet changes.
181
+
182
+ # Reviewing Changes
183
+
184
+ The review process is a conversation between the submitter and the reviewer(s).
185
+ Please feel free to bring other people into the conversation as necessary.
186
+
187
+ As either the submitter or reviewer, feel free to assign the Pull Request to a repository contributor.
188
+ This is a way of indicating that you want that repository contributor to review the change.
189
+
190
+ When you do assign someone to the Pull Request, please make sure to add a comment stating why you assigned it to them.
191
+
192
+ ## Responsibilities of a Reviewer
193
+
194
+ As a reviewer, it is important that the pull request:
195
+
196
+ * Has a [well written commit message](#well-written-commit-messages)
197
+ * Has [well written code](#coding-guidelines)
198
+ * The test suite successfully builds
199
+ * Any questions regarding the pull request are answered
200
+ * Adjucate if the Pull Request should be squashed into a smaller number of commits
201
+
202
+ ## Responsibilities of the Submitter
203
+
204
+ **As the submitter**, you should be responsive to the review process: answering questions, making refinements, providing clarification, and rebasing your commits.
205
+ *If your changes are gridlocked please notify [@jeremyf](https://github.com/jeremyf) via a comment on the pull request.*
206
+
207
+ ## Who Will be Doing the Review
208
+
209
+ Anyone is welcome to contribute to the review process.
210
+ At this stage in the development, [@jeremyf](https://github.com/jeremyf) is the only person that will merge pull requests.
211
+
212
+ # Merging Changes
213
+
214
+ *If a pull request has received at least one Thumbs Up, but has still not been merged, please notify [@jeremyf](https://github.com/jeremyf) via a comment on the pull request.*
215
+
216
+ **As the submitter,** you should not merge your own pull request. That is bad form.
217
+
218
+ **As the reviewer,** if you are comfortable merge the pull request. Otherwise feel free to assign the pull request to another contributor for final merging.
219
+
220
+ **As the merger,** once you have merged the pull request, go ahead and delete the pull request's topic branch. You are now on the hook for any breaking of the build.
data/Gemfile ADDED
@@ -0,0 +1,36 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Declare your gem's dependencies in hydramata-work.gemspec.
4
+ # Bundler will treat runtime dependencies like base dependencies, and
5
+ # development dependencies will be added by default to the :development group.
6
+ gemspec path: File.expand_path('..', __FILE__)
7
+
8
+ # Declare any dependencies that are still in development here instead of in
9
+ # your gemspec. These might include edge Rails or gems from your path or
10
+ # Git. Remember to move these dependencies to your gemspec before releasing
11
+ # your gem to rubygems.org.
12
+
13
+ # To use debugger
14
+ # gem 'debugger'
15
+
16
+ gem 'equivalent-xml', github: 'jeremyf/equivalent-xml', branch: 'updating-rspec-for-rspec-3'
17
+ gem "rake"
18
+ gem 'coveralls', require: false
19
+ if ! ENV['TRAVIS']
20
+ gem 'simplecov', require: false
21
+ gem 'guard-rspec'
22
+ gem 'guard-bundler'
23
+ gem 'guard-rails'
24
+ gem 'rb-fsevent'
25
+ gem 'terminal-notifier-guard'
26
+ gem 'sexp_processor'
27
+ gem 'ruby_parser'
28
+ gem 'pry', '~> 0.9.7'
29
+ gem 'pry-nav'
30
+ end
31
+
32
+ file = File.expand_path("Gemfile", ENV['ENGINE_CART_DESTINATION'] || ENV['RAILS_ROOT'] || File.expand_path("../spec/internal", __FILE__))
33
+ if File.exists?(file)
34
+ puts "Loading #{file} ..." if $DEBUG # `ruby -d` or `bundle -v`
35
+ instance_eval File.read(file)
36
+ end
@@ -0,0 +1,36 @@
1
+ # A sample Guardfile
2
+ # More info at https://github.com/guard/guard#readme
3
+
4
+ guard :bundler do
5
+ watch('Gemfile')
6
+ watch(/^.+\.gemspec/)
7
+ end
8
+
9
+ guard 'rails', root: 'spec/internal', port: 3001 do
10
+ watch('Gemfile.lock')
11
+ watch(%r{^(config|lib)/.*})
12
+ end
13
+
14
+
15
+ guard :rspec do
16
+ watch(%r{^spec/.+_spec\.rb$})
17
+ watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
18
+ watch(%r{^spec/(.+)_helper.rb$}) { |m| "spec" }
19
+
20
+ # Rails example
21
+ watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
22
+ watch(%r{^app/(.*)(\.erb|\.haml|\.slim)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
23
+ watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
24
+ watch(%r{^spec/support/(.+)\.rb$}) { "spec" }
25
+ watch('config/routes.rb') { "spec/routing" }
26
+ watch('app/controllers/application_controller.rb') { "spec/controllers" }
27
+
28
+ # Capybara features specs
29
+ # watch(%r{^app/views/(.+)/.*\.(erb|haml|slim)$}) { |m| "spec/features/#{m[1]}_spec.rb" }
30
+
31
+ # Turnip features and steps
32
+ # watch(%r{^spec/acceptance/(.+)\.feature$})
33
+ # watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
34
+ end
35
+
36
+
data/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ##########################################################################
2
+ # Copyright 2014 University of Notre Dame
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+
@@ -0,0 +1,36 @@
1
+ # Hydramata::Works
2
+
3
+ [![Version](https://badge.fury.io/rb/hydramata-work.png)](http://badge.fury.io/rb/hydramata-work)
4
+ [![Build Status](https://travis-ci.org/jeremyf/hydramata-work.png?branch=master)](https://travis-ci.org/jeremyf/hydramata-work)
5
+ [![Code Climate](https://codeclimate.com/github/jeremyf/hydramata-work.png)](https://codeclimate.com/github/jeremyf/hydramata-work)
6
+ [![Coverage Status](https://img.shields.io/coveralls/jeremyf/hydramata-work.svg)](https://coveralls.io/r/jeremyf/hydramata-work)
7
+ [![API Docs](http://img.shields.io/badge/API-docs-blue.svg)](http://rubydoc.info/github/jeremyf/hydramata-work/master/frames/)
8
+ [![APACHE 2 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
9
+
10
+ Responsible for providing a well defined data-structure to ease the interaction between differing layers of an application:
11
+
12
+ * Persistence Layer
13
+ * In Memory
14
+ * Rendering/Output Buffer
15
+
16
+ ## Getting Started
17
+
18
+ Presently Hydramata::Works is a work in progress, and very much not ready for production usage.
19
+
20
+ But I would encourage you to:
21
+
22
+ 1. Clone the repository: `git clone https://github.com/jeremyf/hydramata-work.git hydramata-work`
23
+ 1. Change to the repository's directory: `cd hydramata-work`
24
+ 1. Install the base dependencies: `bundle install`
25
+ 1. Run the default rake task: `rake`
26
+
27
+ The rake task will build the internal rails application and run all of the tests.
28
+
29
+ Once you have the `spec/internal` directory built, you can run `rspec` or `rake spec:all`.
30
+
31
+ ## Resources
32
+
33
+ * [Vision of Hydramata::Works](./VISION.md)
34
+ * [Contributing Guidelines](./CONTRIBUTING.md)
35
+ * [Todo](./TODO.md)
36
+ * [Design Documents](./documents/)
@@ -0,0 +1,47 @@
1
+ begin
2
+ require 'bundler/setup'
3
+ rescue LoadError
4
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
5
+ end
6
+
7
+ Bundler::GemHelper.install_tasks
8
+
9
+ begin
10
+ APP_RAKEFILE = File.expand_path('../spec/internal/Rakefile', __FILE__)
11
+ load 'rails/tasks/engine.rake'
12
+ rescue LoadError
13
+ puts "Unable to load all app tasks for #{APP_RAKEFILE}"
14
+ end
15
+
16
+ require 'engine_cart/rake_task'
17
+ # http://stackoverflow.com/questions/23165506/rails-spring-breaking-generators
18
+ # https://github.com/cbeer/engine_cart/issues/15
19
+ EngineCart.rails_options = '--skip-spring'
20
+ require 'rspec/core/rake_task'
21
+
22
+ namespace :spec do
23
+ RSpec::Core::RakeTask.new(:all) do
24
+ ENV['COVERAGE'] = 'true'
25
+ end
26
+
27
+ desc 'Run the Travis CI specs'
28
+ task :travis do
29
+ ENV['RAILS_ENV'] = 'test'
30
+ spec_helper = File.expand_path('../spec/spec_slow_helper.rb', __FILE__)
31
+ ENV['SPEC_OPTS'] = "--profile 20 --require #{spec_helper}"
32
+ Rake::Task['engine_cart:clean'].invoke
33
+ Rake::Task['engine_cart:generate'].invoke
34
+ Rake::Task['spec:all'].invoke
35
+ end
36
+ end
37
+
38
+ begin
39
+ Rake::Task['default'].clear
40
+ rescue RuntimeError
41
+ puts 'Unable to find :default rake task; No worries.'
42
+ end
43
+
44
+ Rake::Task['spec'].clear
45
+
46
+ task spec: 'spec:all'
47
+ task default: 'spec:travis'
data/TODO.md ADDED
@@ -0,0 +1,74 @@
1
+ # Todo
2
+
3
+ This is a non-exhaustive scratch pad for TODO items.
4
+
5
+ ## Top Level Features
6
+
7
+ These features reflect the movement of data from one layer to another.
8
+ In each layer, there is a concept of a Work and its data structure.
9
+
10
+ - [x] Fedora -> Memory
11
+ - [x] Memory -> Show HTML
12
+ - [x] Memory -> Show JSON
13
+ - [x] Memory -> Edit HTML
14
+ - [ ] Database -> Memory
15
+ - [ ] Solr -> Memory
16
+ - [ ] Memory -> Fedora
17
+ - [ ] Memory -> Database
18
+ - [ ] Memory -> Solr
19
+ - [ ] Memory -> New HTML
20
+ - [ ] Memory -> Solr Document
21
+ - [X] UI Input for New -> Memory
22
+ - [ ] UI Input for Edit -> Memory
23
+ - [X] Validation in Memory Object
24
+
25
+ ## Low Level Tasks
26
+
27
+ These should not be considered exhaustive.
28
+ But are instead a parking lot that may be cleared or added to.
29
+
30
+ - [X] Default entity rendering to include work_type as one of the partial
31
+ prefixes.
32
+ - [X] Default fieldset rendering to include work_type and fieldset name as the
33
+ partial prefixes.
34
+ - [X] Default fieldset rendering to include work_type, fieldset name, and
35
+ predicate name as the partial prefixes.
36
+ - [X] Create Work Type persistence
37
+ - [X] Create Work Type conversion
38
+ - [X] Create Work Type presentation structure persistence
39
+ - [X] Integrate presentation structure persistence with construction of in memory objects for presentation
40
+ - [X] Remove some duplication of Work Type and Predicate (moving towards a Definition concept?)
41
+ - [X] Create some rudimentary seeds for Work Types
42
+ - [X] Create some rudimentary seeds for Work Types presentation structure
43
+ - [X] Create some rudimentary seeds for Predicates
44
+ - [ ] Disambigutate identity vs. name for application usage
45
+ - [X] Allow for the declaration of validations for a given Predicate
46
+ - [ ] Tidy up validation services; Presently it has lots of knowledge of Entity's structure
47
+ - [X] Improve internationalization support by providing a better key path.
48
+ - [X] Add view tests for show templates
49
+ - [ ] Add view tests for edit templates
50
+ - [ ] Reify an object from persistence then apply value changes
51
+ - [ ] Review view rendering path options; Presently the top level work type is created.
52
+ - [X] Add PresentationStructure builder by WorkType; This is done by interrogating the
53
+ data storage.
54
+ - [X] Add support for multi rails
55
+ - [ ] dom_class should derive from system symbol for identifier
56
+ - [ ] dom_class should accept prefix and suffix
57
+ - [ ] itemprop: for the Property presenter (for Microdata)
58
+ - [X] itemtype for WorkType presenter (RDFa and Microdata)
59
+ - [ ] When persisting Validations make sure to validate that the serialized document is valid
60
+ - [X] Conversion for Entity to EntityPresenter; Or Presenter() conversion
61
+ - [X] Create a NullWorkType concept.
62
+ It would be helpful to create a Null Work Type, so our application doesn't choke.
63
+ - [X] Add internationalization for Work Type contexts:
64
+ - [X] Work type name
65
+ - [X] Work type description
66
+ - [X] Work type verbose description (fallback to description)
67
+ - [X] Add internationalization for Predicate Set
68
+ - [X] Predicate set name
69
+ - [X] Predicate set description
70
+ - [X] Predicate set verbose description (fallback to description)
71
+ - [X] Add internationalization for Predicate
72
+ - [X] Predicate label
73
+ - [X] Predicate description (hint)
74
+ - [X] Predicate verbose description (fallback to description)