daengine 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. data/Gemfile +17 -17
  2. data/MIT-LICENSE +20 -20
  3. data/Rakefile +29 -29
  4. data/app/assets/javascripts/digital_assets.js +2 -2
  5. data/app/assets/stylesheets/digital_assets.css +4 -4
  6. data/app/controllers/digital_assets_controller.rb +76 -76
  7. data/app/helpers/digital_assets_helper.rb +2 -2
  8. data/app/views/digital_assets/_form.html.erb +17 -17
  9. data/app/views/digital_assets/edit.html.erb +6 -6
  10. data/app/views/digital_assets/index.html.erb +34 -34
  11. data/app/views/digital_assets/new.html.erb +5 -5
  12. data/app/views/digital_assets/search.html.erb +46 -46
  13. data/app/views/digital_assets/show.html.erb +58 -58
  14. data/config/routes.rb +8 -8
  15. data/lib/daengine.rb +72 -44
  16. data/lib/daengine/digital_asset_processor.rb +89 -56
  17. data/lib/daengine/engine.rb +6 -6
  18. data/lib/daengine/teamsite_metadata_parser.rb +10 -1
  19. data/lib/daengine/version.rb +3 -3
  20. data/lib/tasks/daengine_tasks.rake +4 -4
  21. data/spec/controllers/digital_assets_controller_spec.rb +202 -202
  22. data/spec/dummy/README.rdoc +261 -261
  23. data/spec/dummy/Rakefile +7 -7
  24. data/spec/dummy/app/assets/javascripts/application.js +15 -15
  25. data/spec/dummy/app/assets/stylesheets/application.css +13 -13
  26. data/spec/dummy/app/controllers/application_controller.rb +3 -3
  27. data/spec/dummy/app/helpers/application_helper.rb +2 -2
  28. data/spec/dummy/app/views/layouts/application.html.erb +14 -14
  29. data/spec/dummy/config.ru +4 -4
  30. data/spec/dummy/config/application.rb +70 -70
  31. data/spec/dummy/config/boot.rb +9 -9
  32. data/spec/dummy/config/environment.rb +5 -5
  33. data/spec/dummy/config/environments/development.rb +37 -37
  34. data/spec/dummy/config/environments/production.rb +67 -67
  35. data/spec/dummy/config/environments/test.rb +37 -37
  36. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -7
  37. data/spec/dummy/config/initializers/inflections.rb +15 -15
  38. data/spec/dummy/config/initializers/mime_types.rb +5 -5
  39. data/spec/dummy/config/initializers/secret_token.rb +7 -7
  40. data/spec/dummy/config/initializers/session_store.rb +8 -8
  41. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -14
  42. data/spec/dummy/config/locales/en.yml +5 -5
  43. data/spec/dummy/config/mongoid.yml +20 -20
  44. data/spec/dummy/config/routes.rb +58 -58
  45. data/spec/dummy/log/development.log +4 -0
  46. data/spec/dummy/log/test.log +435 -0
  47. data/spec/dummy/public/404.html +26 -26
  48. data/spec/dummy/public/422.html +26 -26
  49. data/spec/dummy/public/500.html +25 -25
  50. data/spec/dummy/script/rails +6 -6
  51. data/spec/lib/teamsite_metadata_parser_spec.rb +59 -59
  52. data/spec/spec_helper.rb +40 -40
  53. metadata +17 -12
@@ -1,26 +1,26 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The page you were looking for doesn't exist (404)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/404.html -->
21
- <div class="dialog">
22
- <h1>The page you were looking for doesn't exist.</h1>
23
- <p>You may have mistyped the address or the page may have moved.</p>
24
- </div>
25
- </body>
26
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/404.html -->
21
+ <div class="dialog">
22
+ <h1>The page you were looking for doesn't exist.</h1>
23
+ <p>You may have mistyped the address or the page may have moved.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -1,26 +1,26 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>The change you wanted was rejected (422)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/422.html -->
21
- <div class="dialog">
22
- <h1>The change you wanted was rejected.</h1>
23
- <p>Maybe you tried to change something you didn't have access to.</p>
24
- </div>
25
- </body>
26
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/422.html -->
21
+ <div class="dialog">
22
+ <h1>The change you wanted was rejected.</h1>
23
+ <p>Maybe you tried to change something you didn't have access to.</p>
24
+ </div>
25
+ </body>
26
+ </html>
@@ -1,25 +1,25 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>We're sorry, but something went wrong (500)</title>
5
- <style type="text/css">
6
- body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
- div.dialog {
8
- width: 25em;
9
- padding: 0 4em;
10
- margin: 4em auto 0 auto;
11
- border: 1px solid #ccc;
12
- border-right-color: #999;
13
- border-bottom-color: #999;
14
- }
15
- h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
- </style>
17
- </head>
18
-
19
- <body>
20
- <!-- This file lives in public/500.html -->
21
- <div class="dialog">
22
- <h1>We're sorry, but something went wrong.</h1>
23
- </div>
24
- </body>
25
- </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <style type="text/css">
6
+ body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
7
+ div.dialog {
8
+ width: 25em;
9
+ padding: 0 4em;
10
+ margin: 4em auto 0 auto;
11
+ border: 1px solid #ccc;
12
+ border-right-color: #999;
13
+ border-bottom-color: #999;
14
+ }
15
+ h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
16
+ </style>
17
+ </head>
18
+
19
+ <body>
20
+ <!-- This file lives in public/500.html -->
21
+ <div class="dialog">
22
+ <h1>We're sorry, but something went wrong.</h1>
23
+ </div>
24
+ </body>
25
+ </html>
@@ -1,6 +1,6 @@
1
- #!/usr/bin/env jruby.exe
2
- # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
-
4
- APP_PATH = File.expand_path('../../config/application', __FILE__)
5
- require File.expand_path('../../config/boot', __FILE__)
6
- require 'rails/commands'
1
+ #!/usr/bin/env jruby.exe
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
5
+ require File.expand_path('../../config/boot', __FILE__)
6
+ require 'rails/commands'
@@ -1,60 +1,60 @@
1
- require 'spec_helper'
2
-
3
- describe Daengine::TeamsiteMetadataParser do
4
-
5
- subject { Daengine::TeamsiteMetadataParser }
6
-
7
- context "#parse_tuple_file" do
8
- it 'reads xml' do
9
- # subject.logger= Logger.new(STDOUT)
10
- file = File.expand_path('./spec/mock_data/selective_new_package.xml')
11
- expect {
12
- subject.parse_tuple_file(open(file))
13
- }.to change(DigitalAsset, :count).by(2)
14
- entered = DigitalAsset.first
15
- entered.id.should == '163742d3-fbc2-4c99-8396-6eabe7464b8f'
16
- entered.documents[0].path.should == '/digitalAssets/SSC_Developer_Installation_Guide-163742d3-fbc2-4c99-8396-6eabe7464b8f.doc'
17
- entered.summary.should == 'first foo bar...'
18
- DigitalAsset.first.documents.count.should eq(2)
19
- end
20
- it 'can read a whole bulk deploy xml file quickly' do
21
- # subject.logger= Logger.new(STDOUT)
22
- file = File.expand_path('./spec/mock_data/bulk-ssc_deploy.xml')
23
- open_file = open(file, 'rb')
24
- expect {
25
- subject.parse_tuple_file(open_file)
26
- }.to change(DigitalAsset, :count).by(1588)
27
- end
28
- end
29
-
30
-
31
- context 'deleting paths' do
32
- before do
33
- file = File.expand_path('./spec/mock_data/selective_new_package.xml')
34
- subject.parse_tuple_file(open(file))
35
- end
36
- it 'deletes paths that are no-longer in the tuples for a package' do
37
- file = File.expand_path('./spec/mock_data/selective_path_delete_from_package.xml')
38
- DigitalAsset.find('163742d3-fbc2-4c99-8396-6eabe7464b8f').documents.should have(2).items
39
- expect {
40
- subject.parse_tuple_file(open(file))
41
- }.to change(DigitalAsset, :count).by(0)
42
- DigitalAsset.find('163742d3-fbc2-4c99-8396-6eabe7464b8f').documents.should have(1).item
43
- end
44
- end
45
-
46
- context 'remove unpublished documents from mongo' do
47
- before do
48
- file = File.expand_path('./spec/mock_data/selective-ssc_2012_05_18_13_48_03_publish.xml')
49
- subject.parse_tuple_file(open(file))
50
- end
51
- it 'removes package records from mongo that are in unpublished state' do
52
- DigitalAsset.find('11570991-9887-46df-8c47-d0870e6b5008').documents.should have(1).item
53
- file = File.expand_path('./spec/mock_data/selective-ssc_2012_05_18_13_56_18_unpublish.xml')
54
- expect {
55
- subject.parse_tuple_file(open(file))
56
- }.to change(DigitalAsset, :count).by(-1)
57
- end
58
- end
59
-
1
+ require 'spec_helper'
2
+
3
+ describe Daengine::TeamsiteMetadataParser do
4
+
5
+ subject { Daengine::TeamsiteMetadataParser }
6
+
7
+ context "#parse_tuple_file" do
8
+ it 'reads xml' do
9
+ # subject.logger= Logger.new(STDOUT)
10
+ file = File.expand_path('./spec/mock_data/selective_new_package.xml')
11
+ expect {
12
+ subject.parse_tuple_file(open(file))
13
+ }.to change(DigitalAsset, :count).by(2)
14
+ entered = DigitalAsset.first
15
+ entered.id.should == '163742d3-fbc2-4c99-8396-6eabe7464b8f'
16
+ entered.documents[0].path.should == '/digitalAssets/SSC_Developer_Installation_Guide-163742d3-fbc2-4c99-8396-6eabe7464b8f.doc'
17
+ entered.summary.should == 'first foo bar...'
18
+ DigitalAsset.first.documents.count.should eq(2)
19
+ end
20
+ it 'can read a whole bulk deploy xml file quickly' do
21
+ # subject.logger= Logger.new(STDOUT)
22
+ file = File.expand_path('./spec/mock_data/bulk-ssc_deploy.xml')
23
+ open_file = open(file, 'rb')
24
+ expect {
25
+ subject.parse_tuple_file(open_file)
26
+ }.to change(DigitalAsset, :count).by(1588)
27
+ end
28
+ end
29
+
30
+
31
+ context 'deleting paths' do
32
+ before do
33
+ file = File.expand_path('./spec/mock_data/selective_new_package.xml')
34
+ subject.parse_tuple_file(open(file))
35
+ end
36
+ it 'deletes paths that are no-longer in the tuples for a package' do
37
+ file = File.expand_path('./spec/mock_data/selective_path_delete_from_package.xml')
38
+ DigitalAsset.find('163742d3-fbc2-4c99-8396-6eabe7464b8f').documents.should have(2).items
39
+ expect {
40
+ subject.parse_tuple_file(open(file))
41
+ }.to change(DigitalAsset, :count).by(0)
42
+ DigitalAsset.find('163742d3-fbc2-4c99-8396-6eabe7464b8f').documents.should have(1).item
43
+ end
44
+ end
45
+
46
+ context 'remove unpublished documents from mongo' do
47
+ before do
48
+ file = File.expand_path('./spec/mock_data/selective-ssc_2012_05_18_13_48_03_publish.xml')
49
+ subject.parse_tuple_file(open(file))
50
+ end
51
+ it 'removes package records from mongo that are in unpublished state' do
52
+ DigitalAsset.find('11570991-9887-46df-8c47-d0870e6b5008').documents.should have(1).item
53
+ file = File.expand_path('./spec/mock_data/selective-ssc_2012_05_18_13_56_18_unpublish.xml')
54
+ expect {
55
+ subject.parse_tuple_file(open(file))
56
+ }.to change(DigitalAsset, :count).by(-1)
57
+ end
58
+ end
59
+
60
60
  end
@@ -1,40 +1,40 @@
1
- # This file is copied to spec/ when you run 'rails generate rspec:install'
2
- ENV["RAILS_ENV"] ||= 'test'
3
- # require File.expand_path("../../config/environment", __FILE__)
4
- require File.expand_path("../../spec/dummy/config/environment", __FILE__)
5
- require 'rspec/rails'
6
- require 'factory_girl'
7
- # require 'rspec/autorun'
8
-
9
- # Requires supporting ruby files with custom matchers and macros, etc,
10
- # in spec/support/ and its subdirectories.
11
- Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
12
-
13
- require File.expand_path('../factories.rb', __FILE__)
14
-
15
- RSpec.configure do |config|
16
- # ## Mock Framework
17
- #
18
- # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
19
- #
20
- # config.mock_with :mocha
21
- # config.mock_with :flexmock
22
- # config.mock_with :rr
23
-
24
- # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
25
- # config.fixture_path = "#{::Rails.root}/spec/fixtures"
26
-
27
- # If you're not using ActiveRecord, or you'd prefer not to run each of your
28
- # examples within a transaction, remove the following line or assign false
29
- # instead of true.
30
- # config.use_transactional_fixtures = true
31
-
32
- config.before(:each) do
33
- Mongoid.purge!
34
- end
35
-
36
- # If true, the base class of anonymous controllers will be inferred
37
- # automatically. This will be the default behavior in future versions of
38
- # rspec-rails.
39
- config.infer_base_class_for_anonymous_controllers = false
40
- end
1
+ # This file is copied to spec/ when you run 'rails generate rspec:install'
2
+ ENV["RAILS_ENV"] ||= 'test'
3
+ # require File.expand_path("../../config/environment", __FILE__)
4
+ require File.expand_path("../../spec/dummy/config/environment", __FILE__)
5
+ require 'rspec/rails'
6
+ require 'factory_girl'
7
+ # require 'rspec/autorun'
8
+
9
+ # Requires supporting ruby files with custom matchers and macros, etc,
10
+ # in spec/support/ and its subdirectories.
11
+ Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f}
12
+
13
+ require File.expand_path('../factories.rb', __FILE__)
14
+
15
+ RSpec.configure do |config|
16
+ # ## Mock Framework
17
+ #
18
+ # If you prefer to use mocha, flexmock or RR, uncomment the appropriate line:
19
+ #
20
+ # config.mock_with :mocha
21
+ # config.mock_with :flexmock
22
+ # config.mock_with :rr
23
+
24
+ # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures
25
+ # config.fixture_path = "#{::Rails.root}/spec/fixtures"
26
+
27
+ # If you're not using ActiveRecord, or you'd prefer not to run each of your
28
+ # examples within a transaction, remove the following line or assign false
29
+ # instead of true.
30
+ # config.use_transactional_fixtures = true
31
+
32
+ config.before(:each) do
33
+ Mongoid.purge!
34
+ end
35
+
36
+ # If true, the base class of anonymous controllers will be inferred
37
+ # automatically. This will be the default behavior in future versions of
38
+ # rspec-rails.
39
+ config.infer_base_class_for_anonymous_controllers = false
40
+ end
metadata CHANGED
@@ -2,62 +2,63 @@
2
2
  name: daengine
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - sbhatia
9
+ - ! '@john_s_in_co'
9
10
  autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2012-06-22 00:00:00.000000000Z
13
+ date: 2012-06-25 00:00:00.000000000Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: rails
16
- version_requirements: &2056 !ruby/object:Gem::Requirement
17
+ version_requirements: &2058 !ruby/object:Gem::Requirement
17
18
  requirements:
18
19
  - - ~>
19
20
  - !ruby/object:Gem::Version
20
21
  version: 3.2.3
21
22
  none: false
22
- requirement: *2056
23
+ requirement: *2058
23
24
  prerelease: false
24
25
  type: :runtime
25
26
  - !ruby/object:Gem::Dependency
26
27
  name: mongoid
27
- version_requirements: &2074 !ruby/object:Gem::Requirement
28
+ version_requirements: &2076 !ruby/object:Gem::Requirement
28
29
  requirements:
29
30
  - - ! '>='
30
31
  - !ruby/object:Gem::Version
31
32
  version: '0'
32
33
  none: false
33
- requirement: *2074
34
+ requirement: *2076
34
35
  prerelease: false
35
36
  type: :runtime
36
37
  - !ruby/object:Gem::Dependency
37
38
  name: factory_girl
38
- version_requirements: &2090 !ruby/object:Gem::Requirement
39
+ version_requirements: &2092 !ruby/object:Gem::Requirement
39
40
  requirements:
40
41
  - - ! '>='
41
42
  - !ruby/object:Gem::Version
42
43
  version: '0'
43
44
  none: false
44
- requirement: *2090
45
+ requirement: *2092
45
46
  prerelease: false
46
47
  type: :development
47
48
  - !ruby/object:Gem::Dependency
48
49
  name: rspec-rails
49
- version_requirements: &2108 !ruby/object:Gem::Requirement
50
+ version_requirements: &2110 !ruby/object:Gem::Requirement
50
51
  requirements:
51
52
  - - ! '>='
52
53
  - !ruby/object:Gem::Version
53
54
  version: '0'
54
55
  none: false
55
- requirement: *2108
56
+ requirement: *2110
56
57
  prerelease: false
57
58
  type: :development
58
59
  description: Daengine handles digital asset processing.
59
60
  email:
60
- - samcojava@yahoo.com
61
+ - ML-WebDevelopers@oppenheimerfunds.com
61
62
  executables:
62
63
  - process_assets
63
64
  extensions: []
@@ -112,6 +113,8 @@ files:
112
113
  - spec/dummy/config/initializers/wrap_parameters.rb
113
114
  - spec/dummy/config/locales/en.yml
114
115
  - spec/dummy/db/test.sqlite3
116
+ - spec/dummy/log/development.log
117
+ - spec/dummy/log/test.log
115
118
  - spec/dummy/public/404.html
116
119
  - spec/dummy/public/422.html
117
120
  - spec/dummy/public/500.html
@@ -121,7 +124,7 @@ files:
121
124
  - spec/lib/teamsite_metadata_parser_spec.rb
122
125
  - spec/models/digital_asset_spec.rb
123
126
  - bin/process_assets
124
- homepage: http://www.globalizeyourthinking.com
127
+ homepage: https://github.com/johnsinco/daengine
125
128
  licenses: []
126
129
  post_install_message:
127
130
  rdoc_options: []
@@ -173,6 +176,8 @@ test_files:
173
176
  - spec/dummy/config/initializers/wrap_parameters.rb
174
177
  - spec/dummy/config/locales/en.yml
175
178
  - spec/dummy/db/test.sqlite3
179
+ - spec/dummy/log/development.log
180
+ - spec/dummy/log/test.log
176
181
  - spec/dummy/public/404.html
177
182
  - spec/dummy/public/422.html
178
183
  - spec/dummy/public/500.html