parsecom-importer 0.0.2 → 0.0.3

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.
data/README.md CHANGED
@@ -22,6 +22,10 @@ Call parse-import command.
22
22
 
23
23
  $ parse-import 50523f10-2b8a-4bb8-83ef-31d2fa71f82d_1585107803_export.zip
24
24
 
25
+ Or, give credentials directly
26
+
27
+ $ parse-import --appid=xxxxx --apikey=xxxxx --masterkey=xxxxx 50523f10-2b8a-4bb8-83ef-31d2fa71f82d_1585107803_export.zip
28
+
25
29
  ## Note
26
30
 
27
31
  The behavior of this command is different from importing json files on the web. Though importing on the web is allowed to set objectId and other reserved columns, this command is not. In short, this command changes objectIds and cannot copy some reserved columns.
@@ -6,9 +6,21 @@ rescue LoadError
6
6
  require 'rubygems'
7
7
  require 'parse/importer'
8
8
  end
9
+ require 'optparse'
10
+
11
+ ::Version = Parse::Importer::VERSION
12
+ COMMAND_LINE = "#{$0} #{ARGV.join(' ')}"
13
+ credentials = {}
14
+ opts = OptionParser.new
15
+ opts.on('--appid <Application ID>') {|v| credentials[:application_id] = v}
16
+ opts.on('--apikey <REST API Key>') {|v| credentials[:api_key] = v}
17
+ opts.on('--masterkey <Master Key>') {|v| credentials[:master_key] = v}
18
+ opts.on_tail('-v', '--version', 'Show version.'){puts(opts.ver); exit}
19
+ opts.on_tail('-h', '--help', 'Show this message.'){puts(opts.help); exit}
20
+ opts.order! ARGV
9
21
 
10
22
  if ARGV.empty?
11
- puts 'dirname'
23
+ puts 'Usage: parsecom-import [zipfile path]'
12
24
  exit
13
25
  end
14
- Parse::Importer.import ARGV.shift
26
+ Parse::Importer.import ARGV.shift, credentials
@@ -1,5 +1,5 @@
1
1
  module Parse
2
2
  module Importer
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parsecom-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-10-30 00:00:00.000000000 Z
12
+ date: 2013-11-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: parsecom