rubysync 0.0.5 → 0.1.0

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.
Files changed (117) hide show
  1. data/HISTORY.txt +7 -0
  2. data/Manifest.txt +18 -76
  3. data/Rakefile +2 -2
  4. data/bin/rubysync +60 -21
  5. data/bin/rubysync.rb +60 -21
  6. data/examples/ar_webapp/public/dispatch.cgi +1 -1
  7. data/examples/ar_webapp/public/dispatch.fcgi +1 -1
  8. data/examples/ar_webapp/public/dispatch.rb +1 -1
  9. data/examples/csv_to_ldap/config/connectors/hr_connector.rb +14 -0
  10. data/examples/csv_to_ldap/config/connectors/ldap_vault_connector.rb +11 -0
  11. data/examples/{ar_webapp/.DS_Store → csv_to_ldap/config/db/HrImportPipeline(vault)_assoc_to_path.db} +0 -0
  12. data/{.DS_Store → examples/csv_to_ldap/config/db/HrImportPipeline(vault)_mirror.db} +0 -0
  13. data/examples/csv_to_ldap/config/db/HrImportPipeline(vault)_path_to_assoc.db +0 -0
  14. data/examples/csv_to_ldap/config/pipelines/hr_import_pipeline.rb +24 -0
  15. data/examples/csv_to_ldap/in/henchmen.csv.bak +3 -0
  16. data/examples/csv_to_xml/config/connectors/databank_connector.rb +8 -0
  17. data/examples/csv_to_xml/config/connectors/hr_connector.rb +14 -0
  18. data/examples/csv_to_xml/config/db/HrImportPipeline(vault)_assoc_to_path.db +0 -0
  19. data/examples/csv_to_xml/config/db/HrImportPipeline(vault)_mirror.db +0 -0
  20. data/examples/csv_to_xml/config/db/HrImportPipeline(vault)_path_to_assoc.db +0 -0
  21. data/examples/csv_to_xml/config/pipelines/hr_import_pipeline.rb +24 -0
  22. data/examples/csv_to_xml/databank.xml +1 -0
  23. data/examples/csv_to_xml/in/henchmen.csv.bak +3 -0
  24. data/examples/csv_to_xml/transcript.txt +1 -2
  25. data/examples/data/henchmen.csv +3 -0
  26. data/examples/data/more.csv +2 -0
  27. data/lib/ruby_sync/connectors/active_record_connector.rb +19 -4
  28. data/lib/ruby_sync/connectors/base_connector.rb +3 -9
  29. data/lib/ruby_sync/connectors/file_connector.rb +2 -2
  30. data/lib/ruby_sync/event.rb +16 -9
  31. data/lib/ruby_sync/pipelines/base_pipeline.rb +137 -164
  32. data/lib/ruby_sync/util/utilities.rb +14 -21
  33. data/lib/ruby_sync.rb +37 -39
  34. data/test/ruby_sync_test.rb +3 -2
  35. data/test/tc_active_record_connector.rb +15 -6
  36. data/test/tc_csv_file_connector.rb +10 -6
  37. data/test/tc_ldap_connector.rb +1 -1
  38. data/test/tc_memory_connectors.rb +5 -3
  39. data/test/tc_transformation.rb +15 -7
  40. data/test/tc_utilities.rb +1 -1
  41. data/test/tc_xml_connectors.rb +4 -0
  42. data/test/ts_rubysync.rb +3 -1
  43. metadata +21 -81
  44. data/.project +0 -17
  45. data/docs/in_pipeline.graffle +0 -2690
  46. data/docs/out_pipeline.graffle +0 -3274
  47. data/docs/to_sync.txt +0 -15
  48. data/docs/walkthru.txt +0 -186
  49. data/examples/ar_client_webapp/README +0 -182
  50. data/examples/ar_client_webapp/Rakefile +0 -10
  51. data/examples/ar_client_webapp/app/controllers/application.rb +0 -7
  52. data/examples/ar_client_webapp/app/controllers/user_controller.rb +0 -5
  53. data/examples/ar_client_webapp/app/helpers/application_helper.rb +0 -3
  54. data/examples/ar_client_webapp/app/helpers/user_helper.rb +0 -2
  55. data/examples/ar_client_webapp/app/models/user.rb +0 -2
  56. data/examples/ar_client_webapp/config/boot.rb +0 -45
  57. data/examples/ar_client_webapp/config/database.yml +0 -36
  58. data/examples/ar_client_webapp/config/environment.rb +0 -60
  59. data/examples/ar_client_webapp/config/environments/development.rb +0 -21
  60. data/examples/ar_client_webapp/config/environments/production.rb +0 -18
  61. data/examples/ar_client_webapp/config/environments/test.rb +0 -19
  62. data/examples/ar_client_webapp/config/routes.rb +0 -23
  63. data/examples/ar_client_webapp/db/migrate/001_create_users.rb +0 -13
  64. data/examples/ar_client_webapp/db/schema.rb +0 -13
  65. data/examples/ar_client_webapp/doc/README_FOR_APP +0 -2
  66. data/examples/ar_client_webapp/log/development.log +0 -753
  67. data/examples/ar_client_webapp/log/production.log +0 -0
  68. data/examples/ar_client_webapp/log/server.log +0 -0
  69. data/examples/ar_client_webapp/log/test.log +0 -0
  70. data/examples/ar_client_webapp/public/.htaccess +0 -40
  71. data/examples/ar_client_webapp/public/404.html +0 -30
  72. data/examples/ar_client_webapp/public/500.html +0 -30
  73. data/examples/ar_client_webapp/public/dispatch.cgi +0 -10
  74. data/examples/ar_client_webapp/public/dispatch.fcgi +0 -24
  75. data/examples/ar_client_webapp/public/dispatch.rb +0 -10
  76. data/examples/ar_client_webapp/public/favicon.ico +0 -0
  77. data/examples/ar_client_webapp/public/images/rails.png +0 -0
  78. data/examples/ar_client_webapp/public/index.html +0 -277
  79. data/examples/ar_client_webapp/public/javascripts/application.js +0 -2
  80. data/examples/ar_client_webapp/public/javascripts/controls.js +0 -833
  81. data/examples/ar_client_webapp/public/javascripts/dragdrop.js +0 -942
  82. data/examples/ar_client_webapp/public/javascripts/effects.js +0 -1088
  83. data/examples/ar_client_webapp/public/javascripts/prototype.js +0 -2515
  84. data/examples/ar_client_webapp/public/robots.txt +0 -1
  85. data/examples/ar_client_webapp/script/about +0 -3
  86. data/examples/ar_client_webapp/script/breakpointer +0 -3
  87. data/examples/ar_client_webapp/script/console +0 -3
  88. data/examples/ar_client_webapp/script/destroy +0 -3
  89. data/examples/ar_client_webapp/script/generate +0 -3
  90. data/examples/ar_client_webapp/script/performance/benchmarker +0 -3
  91. data/examples/ar_client_webapp/script/performance/profiler +0 -3
  92. data/examples/ar_client_webapp/script/plugin +0 -3
  93. data/examples/ar_client_webapp/script/process/inspector +0 -3
  94. data/examples/ar_client_webapp/script/process/reaper +0 -3
  95. data/examples/ar_client_webapp/script/process/spawner +0 -3
  96. data/examples/ar_client_webapp/script/runner +0 -3
  97. data/examples/ar_client_webapp/script/server +0 -3
  98. data/examples/ar_client_webapp/test/fixtures/users.yml +0 -5
  99. data/examples/ar_client_webapp/test/functional/user_controller_test.rb +0 -18
  100. data/examples/ar_client_webapp/test/test_helper.rb +0 -28
  101. data/examples/ar_client_webapp/test/unit/user_test.rb +0 -10
  102. data/examples/ar_client_webapp/tmp/sessions/ruby_sess.e2e3c63a67baef6d +0 -0
  103. data/examples/ar_webapp/app/.DS_Store +0 -0
  104. data/examples/ar_webapp/app/views/.DS_Store +0 -0
  105. data/examples/ar_webapp/app/views/people/.DS_Store +0 -0
  106. data/examples/ims2/connectors/hr_db_connector.rb +0 -6
  107. data/examples/ims2/connectors/my_csv_connector.rb +0 -12
  108. data/examples/ims2/pipelines/hr_import_pipeline.rb +0 -33
  109. data/examples/my_ims/connectors/my_csv_connector.rb +0 -10
  110. data/examples/my_ims/connectors/my_db_connector.rb +0 -7
  111. data/examples/my_ims/pipelines/my_pipeline.rb +0 -33
  112. data/lib/rubysync.rb +0 -19
  113. data/nbproject/private/private.properties +0 -3
  114. data/nbproject/project.properties +0 -8
  115. data/nbproject/project.xml +0 -16
  116. data/rubysync.tmproj +0 -568
  117. data/test/tc_rubysync.rb +0 -28
@@ -1 +0,0 @@
1
- # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/about'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/breakpointer'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/console'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/destroy'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/generate'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/performance/benchmarker'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/performance/profiler'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/plugin'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/inspector'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/reaper'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../../config/boot'
3
- require 'commands/process/spawner'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/runner'
@@ -1,3 +0,0 @@
1
- #!/usr/bin/env ruby
2
- require File.dirname(__FILE__) + '/../config/boot'
3
- require 'commands/server'
@@ -1,5 +0,0 @@
1
- # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
2
- one:
3
- id: 1
4
- two:
5
- id: 2
@@ -1,18 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
- require 'user_controller'
3
-
4
- # Re-raise errors caught by the controller.
5
- class UserController; def rescue_action(e) raise e end; end
6
-
7
- class UserControllerTest < Test::Unit::TestCase
8
- def setup
9
- @controller = UserController.new
10
- @request = ActionController::TestRequest.new
11
- @response = ActionController::TestResponse.new
12
- end
13
-
14
- # Replace this with your real tests.
15
- def test_truth
16
- assert true
17
- end
18
- end
@@ -1,28 +0,0 @@
1
- ENV["RAILS_ENV"] = "test"
2
- require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
- require 'test_help'
4
-
5
- class Test::Unit::TestCase
6
- # Transactional fixtures accelerate your tests by wrapping each test method
7
- # in a transaction that's rolled back on completion. This ensures that the
8
- # test database remains unchanged so your fixtures don't have to be reloaded
9
- # between every test method. Fewer database queries means faster tests.
10
- #
11
- # Read Mike Clark's excellent walkthrough at
12
- # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
- #
14
- # Every Active Record database supports transactions except MyISAM tables
15
- # in MySQL. Turn off transactional fixtures in this case; however, if you
16
- # don't care one way or the other, switching from MyISAM to InnoDB tables
17
- # is recommended.
18
- self.use_transactional_fixtures = true
19
-
20
- # Instantiated fixtures are slow, but give you @david where otherwise you
21
- # would need people(:david). If you don't want to migrate your existing
22
- # test cases which use the @david style and don't mind the speed hit (each
23
- # instantiated fixtures translates to a database query per test method),
24
- # then set this back to true.
25
- self.use_instantiated_fixtures = false
26
-
27
- # Add more helper methods to be used by all tests here...
28
- end
@@ -1,10 +0,0 @@
1
- require File.dirname(__FILE__) + '/../test_helper'
2
-
3
- class UserTest < Test::Unit::TestCase
4
- fixtures :users
5
-
6
- # Replace this with your real tests.
7
- def test_truth
8
- assert true
9
- end
10
- end
Binary file
Binary file
@@ -1,6 +0,0 @@
1
- class HrDbConnector < RubySync::Connectors::ActiveRecordConnector
2
- name "HR Database",
3
- application "#{File.dirname(__FILE__)}/../../ar_webapp",
4
- model :person
5
-
6
- end
@@ -1,12 +0,0 @@
1
- class MyCsvConnector < RubySync::Connectors::CsvFileConnector
2
- options(
3
- :name=>"MyCSV",
4
- :field_names=>['given name', 'last name', 'phone number', 'email'],
5
- :path_field=>'email',
6
- :in_path=>'/tmp/csv/in',
7
- :out_path=>'/tmp/csv/out',
8
- :in_glob=>'*.csv',
9
- :out_extension=>'.csv'
10
- )
11
-
12
- end
@@ -1,33 +0,0 @@
1
- class HrImportPipeline < RubySync::Pipelines::BasePipeline
2
-
3
- client :my_csv
4
-
5
- vault :hr_db
6
-
7
- # Remove any fields that you don't want to set in the client from the vault
8
- allow_out :first_name, :last_name
9
-
10
- # Remove any fields that you don't want to set in the vault from the client
11
- allow_in :first_name, :last_name
12
-
13
- # If the client and vault have different names for the same field, define the
14
- # the mapping here. For example, if the vault has a field called "first name" and
15
- # the client has a field called givenName you may put:
16
- # 'first name' => 'givenName'
17
- # separate each mapping with a comma.
18
- # The following fields were detected on the client:
19
- # 'given name', 'last name', 'phone number', 'email'
20
- map_vault_to_client(
21
- 'first_name' => 'given name',
22
- 'last_name' => 'last name'
23
- )
24
-
25
- # "in" means going from client to vault
26
- #in_transform do
27
- #end
28
-
29
- # "out" means going from vault to client
30
- #out_transform do
31
- #end
32
-
33
- end
@@ -1,10 +0,0 @@
1
- class MyCsvConnector < RubySync::Connectors::CsvFileConnector
2
-
3
- field_names ['id', 'given_name', 'surname']
4
- path_field :id
5
- in_path '/tmp/rubysync/in'
6
- out_path '/tmp/rubysync/out'
7
- in_glob '*.csv'
8
- out_extension '.csv'
9
-
10
- end
@@ -1,7 +0,0 @@
1
- class MyDbConnector < RubySync::Connectors::ActiveRecordConnector
2
-
3
- application "#{File.dirname(__FILE__)}/../../ar_webapp"
4
- model 'person'
5
-
6
-
7
- end
@@ -1,33 +0,0 @@
1
- class MyPipeline < RubySync::Pipelines::BasePipeline
2
-
3
- client :my_csv
4
-
5
- vault :my_db
6
-
7
- # Remove any fields that you don't want to set in the client from the vault
8
- allow_out :first_name, :last_name
9
-
10
- # Remove any fields that you don't want to set in the vault from the client
11
- allow_in :first_name, :last_name
12
-
13
- # If the client and vault have different names for the same field, define the
14
- # the mapping here. For example, if the vault has a field called "first name" and
15
- # the client has a field called givenName you may put:
16
- # 'first name' => 'givenName'
17
- # separate each mapping with a comma.
18
- # The following fields were detected on the client:
19
- # 'id', 'given_name', 'surname'
20
- map_vault_to_client(
21
- 'first_name' => 'given_name',
22
- 'last_name' => 'surname'
23
- )
24
-
25
- # "in" means going from client to vault
26
- #in_transform do
27
- #end
28
-
29
- # "out" means going from vault to client
30
- #out_transform do
31
- #end
32
-
33
- end
data/lib/rubysync.rb DELETED
@@ -1,19 +0,0 @@
1
- #!/usr/bin/env ruby -w
2
- #
3
- # Copyright (c) 2007 Ritchie Young. All rights reserved.
4
- #
5
- # This file is part of RubySync.
6
- #
7
- # RubySync is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License
8
- # as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
9
- #
10
- # RubySync is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
11
- # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU General Public License along with RubySync; if not, write to the
14
- # Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
15
-
16
-
17
- class Rubysync
18
- VERSION = '0.0.5'
19
- end
@@ -1,3 +0,0 @@
1
- file.reference.rubysync-bin=/Users/ritchiey/Projects/rubysync/bin
2
- file.reference.rubysync-lib=/Users/ritchiey/Projects/rubysync/lib
3
- file.reference.rubysync-test=/Users/ritchiey/Projects/rubysync/test
@@ -1,8 +0,0 @@
1
- bin.dir=${file.reference.rubysync-bin}
2
- file.reference.rubysync-bin=bin
3
- file.reference.rubysync-lib=lib
4
- file.reference.rubysync-test=test
5
- main.file=
6
- source.encoding=UTF-8
7
- src.dir=${file.reference.rubysync-lib}
8
- test.src.dir=${file.reference.rubysync-test}
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xmlns="http://www.netbeans.org/ns/project/1">
3
- <type>org.netbeans.modules.ruby.rubyproject</type>
4
- <configuration>
5
- <data xmlns="http://www.netbeans.org/ns/ruby-project/1">
6
- <name>RubySync</name>
7
- <source-roots>
8
- <root id="src.dir"/>
9
- <root id="bin.dir"/>
10
- </source-roots>
11
- <test-roots>
12
- <root id="test.src.dir"/>
13
- </test-roots>
14
- </data>
15
- </configuration>
16
- </project>