parse-stack 1.6.9 → 1.6.11

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
  SHA1:
3
- metadata.gz: 9d9cd70e7c2fd02eed7ee1ae5fc51a41c82d8872
4
- data.tar.gz: fda840e7ef5ebee534d6d9129caa6209c0dce3b7
3
+ metadata.gz: 1e8c593e13180e83fb349eff383cab24f11e70e6
4
+ data.tar.gz: 3e97c6ab5b0d7ef055f67553541178734d815fd6
5
5
  SHA512:
6
- metadata.gz: fd0e8042a4c4efef6879708eb457fad2ec39a46b774fcb8295333658974396efdc667a56051c268fd45d9f2741699e373616026ae388d5ee0d682f27aa0c50b4
7
- data.tar.gz: 1828de9ca5b1bcdbdd61be4366d48e0536ff0b3974a1114199cff22a661c86e7ff653e95682360128e5af69ae90b49887a64185627ccb16a53b76f01dacf154d
6
+ metadata.gz: ed75d26379dd431857a469010d2497121c44bff4520076d72906164491dcee17e1a54b047a1c9ed8d2f9d8bc4eb482cd10d5414bf551d40f89a2961a253e8b99
7
+ data.tar.gz: bcf0da08fd9a257b8ae6c6d9bda80e83de4ec5172b9bb0d6733ce3a3b0152a263bd5cae95d909d5a4a9a197a248af744ab0af64e273e1bb47892e8c45773ac52
data/Changes.md CHANGED
@@ -1,10 +1,13 @@
1
1
  ## Parse-Stack Changelog
2
2
 
3
- ### 1.6.8
3
+ ### 1.6.11
4
4
  - NEW: Parse::Object#sig method to get quick information about an instance.
5
- - Adds :delete as an alias method to :destroy
6
- - FIXES: Typo fix when using Array#objectIds.
5
+ - FIX: Typo fix when using Array#objectIds.
6
+ - FIX: Passing server url in parse-console without the `-s` option when using IRB.
7
+ - Exceptions will not be raised on property redefinitions, only warning messages.
7
8
  - Additional tests.
9
+ - Short name classes are generated when using parse-console. Ex. Parse::User -> User
10
+ - parse-console supports `--config-sample` to generate a sample configuration file.
8
11
 
9
12
  ### 1.6.7
10
13
  - Default SERVER_URL changed to http://localhost:1337/parse
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- parse-stack (1.6.9)
4
+ parse-stack (1.6.11)
5
5
  active_model_serializers (>= 0.9, < 1)
6
6
  activemodel (>= 4.2.1, < 6)
7
7
  activesupport (>= 4.2.1, < 6)
@@ -14,54 +14,50 @@ PATH
14
14
  GEM
15
15
  remote: https://rubygems.org/
16
16
  specs:
17
- actionpack (5.0.1)
18
- actionview (= 5.0.1)
19
- activesupport (= 5.0.1)
17
+ actionpack (5.1.0)
18
+ actionview (= 5.1.0)
19
+ activesupport (= 5.1.0)
20
20
  rack (~> 2.0)
21
21
  rack-test (~> 0.6.3)
22
22
  rails-dom-testing (~> 2.0)
23
23
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
- actionview (5.0.1)
25
- activesupport (= 5.0.1)
24
+ actionview (5.1.0)
25
+ activesupport (= 5.1.0)
26
26
  builder (~> 3.1)
27
- erubis (~> 2.7.0)
27
+ erubi (~> 1.4)
28
28
  rails-dom-testing (~> 2.0)
29
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
- active_model_serializers (0.10.4)
29
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
30
+ active_model_serializers (0.10.6)
31
31
  actionpack (>= 4.1, < 6)
32
32
  activemodel (>= 4.1, < 6)
33
33
  case_transform (>= 0.2)
34
- jsonapi (= 0.1.1.beta6)
35
- activemodel (5.0.1)
36
- activesupport (= 5.0.1)
37
- activesupport (5.0.1)
34
+ jsonapi-renderer (>= 0.1.1.beta1, < 0.2)
35
+ activemodel (5.1.0)
36
+ activesupport (= 5.1.0)
37
+ activesupport (5.1.0)
38
38
  concurrent-ruby (~> 1.0, >= 1.0.2)
39
39
  i18n (~> 0.7)
40
40
  minitest (~> 5.1)
41
41
  tzinfo (~> 1.1)
42
42
  binding_of_caller (0.7.2)
43
43
  debug_inspector (>= 0.0.1)
44
- builder (3.2.2)
44
+ builder (3.2.3)
45
45
  byebug (9.0.6)
46
46
  case_transform (0.2)
47
47
  activesupport
48
48
  coderay (1.1.1)
49
- concurrent-ruby (1.0.4)
49
+ concurrent-ruby (1.0.5)
50
50
  daemons (1.2.4)
51
51
  debug_inspector (0.0.2)
52
- dotenv (2.1.1)
53
- erubis (2.7.0)
54
- eventmachine (1.2.1)
55
- faraday (0.10.1)
52
+ dotenv (2.2.1)
53
+ erubi (1.6.0)
54
+ eventmachine (1.2.3)
55
+ faraday (0.12.1)
56
56
  multipart-post (>= 1.2, < 3)
57
- faraday_middleware (0.10.1)
57
+ faraday_middleware (0.11.0.1)
58
58
  faraday (>= 0.7.4, < 1.0)
59
- i18n (0.7.0)
60
- jsonapi (0.1.1.beta6)
61
- jsonapi-parser (= 0.1.1.beta3)
62
- jsonapi-renderer (= 0.1.1.beta1)
63
- jsonapi-parser (0.1.1.beta3)
64
- jsonapi-renderer (0.1.1.beta1)
59
+ i18n (0.8.1)
60
+ jsonapi-renderer (0.1.2)
65
61
  loofah (2.0.3)
66
62
  nokogiri (>= 1.5.9)
67
63
  method_source (0.8.2)
@@ -69,9 +65,9 @@ GEM
69
65
  minitest (5.10.1)
70
66
  moneta (0.8.1)
71
67
  multipart-post (2.0.0)
72
- nokogiri (1.7.0.1)
68
+ nokogiri (1.7.1)
73
69
  mini_portile2 (~> 2.1.0)
74
- parallel (1.10.0)
70
+ parallel (1.11.1)
75
71
  pry (0.10.4)
76
72
  coderay (~> 1.1.0)
77
73
  method_source (~> 0.8.1)
@@ -91,16 +87,16 @@ GEM
91
87
  loofah (~> 2.0)
92
88
  rake (12.0.0)
93
89
  redcarpet (3.4.0)
94
- redis (3.3.2)
90
+ redis (3.3.3)
95
91
  slop (3.6.0)
96
92
  thin (1.7.0)
97
93
  daemons (~> 1.0, >= 1.0.9)
98
94
  eventmachine (~> 1.0, >= 1.0.4)
99
95
  rack (>= 1, < 3)
100
- thread_safe (0.3.5)
101
- tzinfo (1.2.2)
96
+ thread_safe (0.3.6)
97
+ tzinfo (1.2.3)
102
98
  thread_safe (~> 0.1)
103
- yard (0.9.5)
99
+ yard (0.9.9)
104
100
 
105
101
  PLATFORMS
106
102
  ruby
@@ -120,4 +116,4 @@ DEPENDENCIES
120
116
  yard
121
117
 
122
118
  BUNDLED WITH
123
- 1.13.6
119
+ 1.13.7
data/README.md CHANGED
@@ -11,16 +11,15 @@ Below is a [quick start guide](https://github.com/modernistik/parse-stack#overvi
11
11
  2. Custom Classes and Relations: https://youtu.be/tfSesotfU7w
12
12
  3. Working with Existing Schemas: https://youtu.be/EJGPT7YWyXA
13
13
 
14
- ### Parse File Migration Tool
15
- **If you are looking for a tool to migrate your hosted Parse Files to an Amazon S3 bucket, see our [Parse File Migration tool here](https://github.com/modernistik/parse-file-migration). This should be done before January 28th, 2017**
16
-
17
14
  ### Code Status
18
- [![Gitter](https://badges.gitter.im/modernistik/parse-stack.svg)](https://gitter.im/modernistik/parse-stack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
19
15
  [![Gem Version](https://img.shields.io/gem/v/parse-stack.svg)](https://github.com/modernistik/parse-stack)
20
16
  [![Downloads](https://img.shields.io/gem/dt/parse-stack.svg)](https://rubygems.org/gems/parse-stack)
21
17
  [![Build Status](https://travis-ci.org/modernistik/parse-stack.svg?branch=master)](https://travis-ci.org/modernistik/parse-stack)
22
18
  [![API Reference](http://img.shields.io/badge/api-docs-blue.svg)](http://www.rubydoc.info/github/modernistik/parse-stack)
23
19
 
20
+ ### Questions?
21
+ [![Gitter](https://badges.gitter.im/modernistik/parse-stack.svg)](https://gitter.im/modernistik/parse-stack?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
22
+
24
23
  ## Installation
25
24
 
26
25
  Add this line to your application's Gemfile:
@@ -45,12 +44,16 @@ Parse-Stack comes with support for Rails by adding additional rake tasks and gen
45
44
 
46
45
  For a more details on the rails integration see [Parse-Stack Rails Example](https://github.com/modernistik/parse-stack-rails-example).
47
46
 
48
- ### Interactive Command Line
49
- You can also used the bundled `parse-console` command line to connect and interact with your Parse Server and its data in an irb-like console:
47
+ ### Interactive Command Line Playground
48
+ You can also used the bundled `parse-console` command line to connect and interact with your Parse Server and its data in an IRB-like console. This is useful for trying concepts and debugging as it will automatically connect to your Parse Server, and if provided the master key, automatically generate all the models entities.
50
49
 
51
50
  ```bash
52
51
  $ parse-console -h # see all options
53
- $ parse-console -a appId -k restAPIKey http://localhost:1337/parse
52
+ $ parse-console -v -a myAppId -m myMasterKey http://localhost:1337/parse
53
+ Server : http://localhost:1337/parse
54
+ App Id : myAppId
55
+ Master : true
56
+ 2.4.0 > Parse::User.first
54
57
  ```
55
58
 
56
59
  ## Overview
data/bin/parse-console CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  require 'optparse'
4
4
  require 'json'
5
+ DEFAULT_CONFIG_FILE = 'config.json'
6
+ DEFAULT_CONFIG_CONTENTS = {
7
+ "apps": [{
8
+ "serverURL": "http://localhost:1337/parse",
9
+ "appId": "myAppId",
10
+ "masterKey": "myMasterKey",
11
+ "restAPIKey": "myRestAPIKey",
12
+ "javascriptKey": "myJavascriptKey",
13
+ "appName": "Parse Server App"
14
+ }]
15
+ }.freeze
5
16
 
6
17
  opts = { verbose: false, pry: false }
7
18
  opt_parser = OptionParser.new do |o|
@@ -9,8 +20,11 @@ opt_parser = OptionParser.new do |o|
9
20
  o.banner = "Usage: #{File.basename($0)} [options] SERVER_URL"
10
21
  o.separator ""
11
22
  o.separator "Example:"
12
- o.separator "#{File.basename($0)} -a APP_ID -k REST_API_KEY http://your-parser-server-url"
13
- o.separator "#{File.basename($0)} -a APP_ID -m MASTER_KEY http://localhost:1337/parse"
23
+ o.separator "#{File.basename($0)} -a APP_ID -m MASTER_KEY https://your-parse-server-url"
24
+ o.separator "#{File.basename($0)} -c ./config.json"
25
+ o.separator ""
26
+ o.separator "If you use the -m option, parse-console will automatically"
27
+ o.separator "import your schema as ruby models."
14
28
  o.separator ""
15
29
  o.separator "Options"
16
30
  o.on('-a APP_ID', '--appId APP_ID', 'Parse App ID (required)') { |a| opts[:app_id] = a }
@@ -24,8 +38,23 @@ opt_parser = OptionParser.new do |o|
24
38
  puts "Parse Stack : #{Parse::Stack::VERSION}"
25
39
  exit 1
26
40
  end
27
- o.on('-c','--config CONFIG_JSON', "Load config from a parse-dashboard json compatible file.") do |filepath|
41
+ o.on('--config-sample', "Create a sample config file to use. See --config.") do
42
+ contents = JSON.pretty_generate(DEFAULT_CONFIG_CONTENTS)
43
+ File.open(DEFAULT_CONFIG_FILE, 'w') { |f| f.write(contents) }
44
+ puts "Created #{DEFAULT_CONFIG_FILE} : \n"
45
+ puts contents
46
+ puts "Edit #{DEFAULT_CONFIG_FILE} with your information and run: \n"
47
+ puts "\n\tparse-console -c ./#{DEFAULT_CONFIG_FILE}\n\n"
48
+ exit 1
49
+ end
50
+ o.on('-c','--config CONFIG_JSON', "Load config from a parse-dashboard.json compatible file.") do |filepath|
51
+ unless File.exists?(filepath)
52
+ $stderr.puts "File #{filepath} does not exist."
53
+ exit 1
54
+ end
55
+
28
56
  begin
57
+ puts "Loading config: #{filepath}"
29
58
  file = File.read(filepath)
30
59
  config = JSON.parse file
31
60
  app = config["apps"].is_a?(Array) ? config["apps"].first : config["apps"]
@@ -34,7 +63,7 @@ opt_parser = OptionParser.new do |o|
34
63
  opts[:api_key] ||= app["restAPIKey"]
35
64
  opts[:master_key] ||= app["masterKey"]
36
65
  rescue Exception => e
37
- $stderr.puts "Error: Incompatible JSON format for #{filepath}"
66
+ $stderr.puts "Error: Incompatible JSON format for #{filepath} (#{e})"
38
67
  exit 1
39
68
  end
40
69
 
@@ -42,7 +71,7 @@ opt_parser = OptionParser.new do |o|
42
71
  end
43
72
  opt_parser.parse!
44
73
 
45
- opts[:server_url] ||= ARGV[0] || 'http://localhost:1337/parse'
74
+ opts[:server_url] ||= ARGV.shift || 'http://localhost:1337/parse'
46
75
 
47
76
  if opts[:app_id].nil?
48
77
  $stderr.puts "Error: Option --app_id missing\n"
@@ -67,9 +96,20 @@ puts "Server : #{Parse.client.server_url}"
67
96
  puts "App Id : #{Parse.client.app_id}"
68
97
  puts "Master : #{opts[:master_key].present?}"
69
98
 
70
- Parse.auto_generate_models!.each do |model|
71
- puts "Generated #{model}" if opts[:verbose]
99
+ if opts[:master_key].present?
100
+ puts "Schema : imported"
101
+ Parse.auto_generate_models!.each do |model|
102
+ puts "Generated #{model}" if opts[:verbose]
103
+ end
104
+ else
105
+ puts "Schema : skipped (requires master key)"
72
106
  end
107
+ # Create shortnames
108
+ User = Parse::User
109
+ Installation = Parse::Installation
110
+ Session = Parse::Session
111
+ Role = Parse::Role
112
+ Product = Parse::Product
73
113
 
74
114
  if opts[:pry]
75
115
  require "pry"
@@ -164,6 +164,7 @@ class Array
164
164
  batch.submit
165
165
  batch
166
166
  end
167
+ # Do not alias method as :delete is already part of array.
167
168
  # alias_method :delete, :destroy
168
169
 
169
170
  # Submit a batch request for deleting a set of Parse::Objects.
data/lib/parse/stack.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # encoding: UTF-8
2
2
  # frozen_string_literal: true
3
-
3
+ # exit # don't use master branch
4
4
  require_relative "stack/version"
5
5
  require_relative 'client'
6
6
  require_relative 'query'
@@ -6,6 +6,6 @@ module Parse
6
6
  # The Parse Server SDK for Ruby
7
7
  module Stack
8
8
  # The current version.
9
- VERSION = "1.6.9"
9
+ VERSION = "1.6.11"
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: parse-stack
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.9
4
+ version: 1.6.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anthony Persaud
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-16 00:00:00.000000000 Z
11
+ date: 2017-05-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel