rails-salesforce-connect 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6de983461999d52a3599c0b942665618a10e931f601ab758745cb4687a752024
4
- data.tar.gz: b0cff1b2a96c55bae1b2aa982c52f4969ed11a0debd4aa9cb267c4be95b597b2
3
+ metadata.gz: 3d830c6114bdb26f557e696abe9b86be52fa8e5f82044d5a40eedf605bdc9d15
4
+ data.tar.gz: 98b0381731ee464e75a557d0fd62f7face50417fba321c14696d75bc956176ec
5
5
  SHA512:
6
- metadata.gz: 114c0be0f1777115dd076004e88b3f924e9c2791859f87684c59bd7849fa041b767423095e817f41c02afb4917d090749cf7e1f944347921f50f37d8ceb7c535
7
- data.tar.gz: b81654388aa5b54e976f0bc39e27479fc06654d82a58279c536c3b8a0ebf362f5a424e89056c71f3922a795b1d374ad499939471963fca3a018296ea58498ed4
6
+ metadata.gz: 7bb7c5f58c719aab9ec64f2c50e8b273e977fc13d4e1e12dedf0be0c9224024da2a997294b58f2fb31703c3d7765c3be577832aafaee1767288b75b1fd4cdb8a
7
+ data.tar.gz: 5f46305c842eaaf1b7b8c0ef26a2a30752aabc9d3b2a97cf4610804bdc7209475f6d4c27a5e5227d77e423523ee82484a182e65565d32edc1fe76375244fb05e
@@ -0,0 +1,21 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # Example:
4
+ #
5
+ # salesforce-connect rake some-task
6
+ #
7
+ # Adapted from StackOverflow solution by N David Brown
8
+
9
+ gem_dir = File.expand_path("..", File.dirname(__FILE__))
10
+ $LOAD_PATH.unshift gem_dir # Look in gem directory for resources first.
11
+ exec_type = ARGV[0]
12
+ if exec_type == 'rake' then
13
+ require 'rake'
14
+ require 'pp'
15
+
16
+ path = File.dirname File.dirname(__FILE__)
17
+ load "#{path}/lib/tasks/diff_schema.rake"
18
+ load "#{path}/lib/tasks/diff_salesforce.rake"
19
+
20
+ Rake.application.invoke_task(ARGV[1])
21
+ end
@@ -1,9 +1,13 @@
1
1
  # frozen_string_literal: true
2
+ require 'json'
3
+ require 'bundler'
4
+ require 'hashdiff'
5
+ Bundler.require
2
6
  namespace :salesforce do
3
7
 
4
8
  namespace :schema do
5
9
  desc "Save the salesforce schema for the given app"
6
- task :dump, [:app_name] => [:environment] do |_t, args|
10
+ task :dump, [:app_name] do |_t, args|
7
11
  env = ENV
8
12
  outfile = 'salesforce-schema.json'
9
13
 
@@ -26,7 +30,7 @@ namespace :salesforce do
26
30
  end
27
31
 
28
32
  desc "Diff two schema files against one another"
29
- task :diff, [:old, :new] => [:environment] do |_t, args|
33
+ task :diff, [:old, :new] do |_t, args|
30
34
  old_h = JSON.parse(File.read(args[:old]))
31
35
  new_h = JSON.parse(File.read(args[:new]))
32
36
 
@@ -42,7 +46,10 @@ namespace :salesforce do
42
46
  diff = true
43
47
  end
44
48
 
45
- HashDiff.diff(old_h.except(*removed), new_h.except(*added)).each do |sym, key, old, new_val|
49
+ removed.each {|k| old_h.delete(k)}
50
+ added.each {|k| new_h.delete(k)}
51
+
52
+ HashDiff.diff(old_h, new_h).each do |sym, key, old, new_val|
46
53
  diff = true
47
54
  case sym
48
55
  when "~"
@@ -1,7 +1,7 @@
1
1
  # gem 'activerecord'
2
2
  Gem::Specification.new do |s|
3
3
  s.name = 'rails-salesforce-connect'
4
- s.version = '0.0.5'
4
+ s.version = '0.0.6'
5
5
  s.licenses = ['MIT']
6
6
  s.summary = "Tools for using heroku connect with rails"
7
7
  s.description = "Base class for salesforce migrations, activerecord types; deduplication rules aware, and rake tasks to sync schema"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-salesforce-connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Heath
@@ -106,6 +106,7 @@ files:
106
106
  - Gemfile
107
107
  - Rakefile
108
108
  - Readme.md
109
+ - bin/salesforce-connect
109
110
  - lib/connect/api_adapter.rb
110
111
  - lib/connect/migration.rb
111
112
  - lib/connect/railtie.rb