fruit_to_lime 2.3.1 → 2.3.2

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 (42) hide show
  1. data/bin/fruit_to_lime +24 -24
  2. data/lib/fruit_to_lime/email_helper.rb +10 -0
  3. data/lib/fruit_to_lime/errors.rb +4 -1
  4. data/lib/fruit_to_lime/excel_helper.rb +10 -0
  5. data/lib/fruit_to_lime/global_phone.json +6571 -0
  6. data/lib/fruit_to_lime/model/class_settings.rb +7 -4
  7. data/lib/fruit_to_lime/model/coworker.rb +2 -2
  8. data/lib/fruit_to_lime/model/coworker_reference.rb +10 -0
  9. data/lib/fruit_to_lime/model/deal.rb +12 -3
  10. data/lib/fruit_to_lime/model/note.rb +42 -1
  11. data/lib/fruit_to_lime/model/organization.rb +29 -7
  12. data/lib/fruit_to_lime/model/person.rb +26 -9
  13. data/lib/fruit_to_lime/model/rootmodel.rb +145 -9
  14. data/lib/fruit_to_lime/phone_helper.rb +74 -0
  15. data/lib/fruit_to_lime.rb +4 -1
  16. data/spec/class_settings_spec.rb +23 -3
  17. data/spec/deal_spec.rb +22 -12
  18. data/spec/helpers/email_helper_spec.rb +32 -0
  19. data/spec/helpers/phone_helper_spec.rb +97 -0
  20. data/spec/helpers/roo_helper_spec.rb +10 -10
  21. data/spec/note_spec.rb +55 -0
  22. data/spec/organization_spec.rb +57 -0
  23. data/spec/person_spec.rb +15 -6
  24. data/spec/rootmodel_spec.rb +133 -7
  25. data/spec/spec_helper.rb +24 -24
  26. data/templates/csv/Gemfile +5 -5
  27. data/templates/csv/Rakefile.rb +7 -7
  28. data/templates/csv/convert.rb +2 -2
  29. data/templates/csv/spec/spec_helper.rb +24 -24
  30. data/templates/excel/Gemfile +6 -6
  31. data/templates/excel/Rakefile.rb +7 -7
  32. data/templates/excel/convert.rb +2 -2
  33. data/templates/excel/lib/tomodel.rb +167 -29
  34. data/templates/excel/spec/spec_helper.rb +20 -20
  35. data/templates/excel/spec/tomodel_spec.rb +18 -18
  36. data/templates/excel/template.xlsx +0 -0
  37. data/templates/sqlserver/Gemfile +6 -6
  38. data/templates/sqlserver/Rakefile.rb +7 -7
  39. data/templates/sqlserver/convert.rb +2 -2
  40. data/templates/sqlserver/spec/spec_helper.rb +20 -20
  41. data/templates/sqlserver/spec/tomodel_spec.rb +9 -9
  42. metadata +47 -2
data/bin/fruit_to_lime CHANGED
@@ -1,24 +1,24 @@
1
- #!/usr/bin/env ruby
2
- require "thor"
3
- require "fruit_to_lime"
4
-
5
- class Cli < Thor
6
- desc "unpack_template NAME PATH", "Unpacks template with NAME in specified PATH or current directory if missing."
7
- def unpack_template(name, path = nil)
8
- path = '.' if path == nil
9
- path = File.absolute_path(path)
10
- templates_path = File.expand_path("../templates", File.dirname(__FILE__))
11
- templating = FruitToLime::Templating.new templates_path
12
- templating.unpack(name, path)
13
- end
14
-
15
- desc "list_templates", "Lists all templates"
16
- def list_templates()
17
- templates_path = File.expand_path("../templates", File.dirname(__FILE__))
18
- templating = FruitToLime::Templating.new templates_path
19
- list_of_templates = templating.list
20
- puts list_of_templates
21
- end
22
- end
23
-
24
- Cli.start(ARGV)
1
+ #!/usr/bin/env ruby
2
+ require "thor"
3
+ require "fruit_to_lime"
4
+
5
+ class Cli < Thor
6
+ desc "unpack_template NAME PATH", "Unpacks template with NAME in specified PATH or current directory if missing."
7
+ def unpack_template(name, path = nil)
8
+ path = '.' if path == nil
9
+ path = File.absolute_path(path)
10
+ templates_path = File.expand_path("../templates", File.dirname(__FILE__))
11
+ templating = FruitToLime::Templating.new templates_path
12
+ templating.unpack(name, path)
13
+ end
14
+
15
+ desc "list_templates", "Lists all templates"
16
+ def list_templates()
17
+ templates_path = File.expand_path("../templates", File.dirname(__FILE__))
18
+ templating = FruitToLime::Templating.new templates_path
19
+ list_of_templates = templating.list
20
+ puts list_of_templates
21
+ end
22
+ end
23
+
24
+ Cli.start(ARGV)
@@ -0,0 +1,10 @@
1
+ require "sixarm_ruby_email_address_validation"
2
+
3
+ module FruitToLime
4
+ # The EmailHelper helps you validate email addresses.
5
+ class EmailHelper
6
+ def self.is_valid?(email)
7
+ return (email =~ EmailAddressValidation::Pattern) ? true : false
8
+ end
9
+ end
10
+ end
@@ -1,4 +1,7 @@
1
1
  module FruitToLime
2
2
  class AlreadyAddedError < StandardError
3
3
  end
4
- end
4
+
5
+ class InvalidCustomFieldError < StandardError
6
+ end
7
+ end
@@ -0,0 +1,10 @@
1
+ module FruitToLime
2
+ # The ExcelHelper just makes it a little bit easier to open an
3
+ # excel file in the imports. With ExcelHelper you don't need to
4
+ # know anything about Roo and RooHelper.
5
+ class ExcelHelper
6
+ def self.Open(excel_filename)
7
+ return RooHelper.new(Roo::Excelx.new(excel_filename))
8
+ end
9
+ end
10
+ end