getapp 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +2 -0
- data/bin/getapp_import +3 -0
- data/lib/getapp.rb +1 -0
- data/lib/getapp/import/capterra.rb +15 -0
- data/lib/getapp/version.rb +1 -1
- data/sql_solution.zip +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02b2b12a84eed0626b5a7398597ce6450a2e611b693da18627ba3b605bc40f84
|
4
|
+
data.tar.gz: 82f69ed3f1821554e69cf84d7c197688739c471c606529e2560a5c2ebadae8fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de9a59e2fa7cbec92d41ff854ea1f82694a7d483a70b12959371cf964404345714981b4c1b0e7f00af35ac667faa4837335f2fe16b278ac9849ec8f57f980997
|
7
|
+
data.tar.gz: c927b6688fa39e454476ea464cfdbde498f33224ccdd11d0ecd73f689fec08dd0d7491b3761f8073ea64b3564caaa73ae9acbbc6bb86f7e55d103a90f26bb664
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -30,6 +30,8 @@ Or install it yourself as:
|
|
30
30
|
|
31
31
|
Currently, supported products imports from capterra and softwareadvice.
|
32
32
|
|
33
|
+
Sample files can be found at under test/assets/feed-products
|
34
|
+
|
33
35
|
## Development
|
34
36
|
|
35
37
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
data/bin/getapp_import
CHANGED
data/lib/getapp.rb
CHANGED
@@ -11,6 +11,8 @@ module Getapp
|
|
11
11
|
# into Getapp Products format.
|
12
12
|
#
|
13
13
|
class Capterra
|
14
|
+
SUPPORTED_FILE_FORMATS = ['.yaml', '.yml'].freeze
|
15
|
+
|
14
16
|
attr_reader :path, :verbose, :products
|
15
17
|
|
16
18
|
# == Getapp::Import::Capterra initialize Method
|
@@ -34,6 +36,7 @@ module Getapp
|
|
34
36
|
#
|
35
37
|
def import
|
36
38
|
check_file_exist?
|
39
|
+
validate_file_formats
|
37
40
|
parse_products
|
38
41
|
import_products
|
39
42
|
true
|
@@ -53,6 +56,18 @@ module Getapp
|
|
53
56
|
raise Getapp::Capterra::FileNotFound, "Capterra: File does not exist." unless File.exist?(path)
|
54
57
|
end
|
55
58
|
|
59
|
+
# == Getapp::Import::Capterra validate_file_formats Private Method
|
60
|
+
#
|
61
|
+
# Check that file have valid format.
|
62
|
+
# Raise an Getapp::Capterra::FileFormatNotSupported exception if
|
63
|
+
# file format is not included in list.
|
64
|
+
#
|
65
|
+
def validate_file_formats
|
66
|
+
file_format = File.extname(path)
|
67
|
+
message = "File format (#{file_format}) not supported yet."
|
68
|
+
raise Getapp::Capterra::FileFormatNotSupported, message unless SUPPORTED_FILE_FORMATS.include?(file_format)
|
69
|
+
end
|
70
|
+
|
56
71
|
# == Getapp::Import::Capterra parse_products Private Method
|
57
72
|
#
|
58
73
|
# Load yaml file into JSON format.
|
data/lib/getapp/version.rb
CHANGED
data/sql_solution.zip
ADDED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getapp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Prince Bansal
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-07-
|
11
|
+
date: 2020-07-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Update product inventory of SaaS products from several sources. Each
|
14
14
|
source provides its content to us in a different format.
|
@@ -38,6 +38,7 @@ files:
|
|
38
38
|
- lib/getapp/import/capterra.rb
|
39
39
|
- lib/getapp/import/products.rb
|
40
40
|
- lib/getapp/version.rb
|
41
|
+
- sql_solution.zip
|
41
42
|
homepage: https://github.com/erprincebansal/getapp
|
42
43
|
licenses:
|
43
44
|
- MIT
|