app_rail-airtable 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +7 -0
- data/Gemfile.lock +1 -1
- data/lib/app_rail/airtable/authenticatable.rb +4 -2
- data/lib/app_rail/airtable/sinatra.rb +2 -0
- data/lib/app_rail/airtable/version.rb +1 -1
- data/templates/project/.gitignore +15 -4
- data/templates/project/Gemfile +11 -5
- data/templates/project/config.ru +7 -1
- data/templates/project/spec/spec_helper.rb +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15aed8edd922ec35c782dd42d03b7beb8e6a797b4bbc68a32f7db968b905c92c
|
4
|
+
data.tar.gz: d864fd4adc4f4fdf2c96d7751e9c7ab7005d629ce0d4109f8221f3173796c7e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6876774d54ef6775fdebc8dc435a33f44ce4a298ac420031c369dcc049e7298d79a204bff276f7f19dba0e4322cce0aee7b089b142ad2d55fdbeeb477f55adc7
|
7
|
+
data.tar.gz: f77814cfdecf5792443e48cc22be7faf05a533c9f798597f39a65c2cd311763a77a1e729e906b746e6c4a7331a9fd42b1a5456b2d2205102be64badfba8ac556
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -12,13 +12,15 @@ module AppRail
|
|
12
12
|
|
13
13
|
module ClassMethods
|
14
14
|
def create(email:, password:)
|
15
|
-
user = User.new("Email" => email, "Password Hash" => password_hash(password), "Access Token" =>
|
15
|
+
user = User.new("Email" => email, "Password Hash" => password_hash(password), "Access Token" => next_access_token)
|
16
16
|
user.create
|
17
17
|
user
|
18
18
|
end
|
19
19
|
|
20
20
|
def create_session_as_json(email:, password:)
|
21
21
|
user = find_by_email_and_password(email, password)
|
22
|
+
user["Access Token"] = next_access_token
|
23
|
+
user.save
|
22
24
|
user&.oauth_session
|
23
25
|
end
|
24
26
|
|
@@ -35,7 +37,7 @@ module AppRail
|
|
35
37
|
BCrypt::Password.create(password)
|
36
38
|
end
|
37
39
|
|
38
|
-
def
|
40
|
+
def next_access_token
|
39
41
|
SecureRandom.hex
|
40
42
|
end
|
41
43
|
end
|
@@ -2,7 +2,18 @@
|
|
2
2
|
*.swp
|
3
3
|
*.rbc
|
4
4
|
*.sass-cache
|
5
|
-
/
|
6
|
-
|
7
|
-
|
8
|
-
/
|
5
|
+
/.bundle/
|
6
|
+
/.yardoc
|
7
|
+
/_yardoc/
|
8
|
+
/coverage/
|
9
|
+
/doc/
|
10
|
+
/pkg/
|
11
|
+
/spec/reports/
|
12
|
+
/tmp/
|
13
|
+
|
14
|
+
# rspec failure tracking
|
15
|
+
.rspec_status
|
16
|
+
.byebug_history
|
17
|
+
|
18
|
+
# dotenv
|
19
|
+
.env
|
data/templates/project/Gemfile
CHANGED
@@ -7,9 +7,15 @@ ruby '2.7.4'
|
|
7
7
|
|
8
8
|
gem 'app_rail-airtable'
|
9
9
|
|
10
|
-
|
11
|
-
gem 'dotenv'
|
10
|
+
group :development do
|
11
|
+
gem 'dotenv'
|
12
|
+
end
|
12
13
|
|
13
|
-
|
14
|
-
gem "rspec"
|
15
|
-
gem "rack-test"
|
14
|
+
group :test do
|
15
|
+
gem "rspec"
|
16
|
+
gem "rack-test"
|
17
|
+
end
|
18
|
+
|
19
|
+
group :development, :test do
|
20
|
+
gem 'byebug'
|
21
|
+
end
|
data/templates/project/config.ru
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
$stdout.sync = true
|
2
2
|
|
3
|
-
|
3
|
+
ENV['RACK_ENV'] ||= 'development'
|
4
|
+
require 'dotenv/load' if ENV['RACK_ENV'] == 'development'
|
5
|
+
require 'bundler'
|
6
|
+
Bundler.require(:default, ENV['RACK_ENV'].to_sym)
|
7
|
+
|
8
|
+
require 'dotenv/load' if ENV['RACK_ENV'] == 'development'
|
9
|
+
|
4
10
|
require './lib/server'
|
5
11
|
run Server
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: app_rail-airtable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Brooke-Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-10-
|
11
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|