-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvironment.rb
123 lines (106 loc) · 1.82 KB
/
environment.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
require 'bundler'
Bundler.require
Dir.glob('./lib/*.rb').each { |f| require(f) }
Dir.glob('./routes/*.rb').each { |f| require(f) }
USE_HTTPS = true
LOCAL_DOMAIN = 'johnholdun.localtunnel.me'.freeze
BASE_URL = "http#{'s' if USE_HTTPS}://#{LOCAL_DOMAIN}"
LD_CONTEXT = {
'@context': [
'https://www.w3.org/ns/activitystreams',
'https://w3id.org/security/v1'
]
}.freeze
PUBLIC = 'https://www.w3.org/ns/activitystreams#Public'.freeze
CORE_TYPES =
%w(
Object
Link
Activity
IntransitiveActivity
Collection
OrderedCollection
CollectionPage
OrderedCollectionPage
)
ACTIVITY_TYPES =
%w(
Accept
Add
Announce
Arrive
Block
Create
Delete
Dislike
Flag
Follow
Ignore
Invite
Join
Leave
Like
Listen
Move
Offer
Question
Reject
Read
Remove
TentativeReject
TentativeAccept
Travel
Undo
Update
View
).freeze
ACTOR_TYPES =
%w(
Application
Group
Organization
Person
Service
).freeze
OBJECT_TYPES =
%w(
Article
Audio
Document
Event
Image
Note
Page
Place
Profile
Relationship
Tombstone
Video
).freeze
LINK_TYPES = %w(Mention).freeze
TYPES =
(
CORE_TYPES &
ACTIVITY_TYPES &
ACTOR_TYPES &
OBJECT_TYPES &
LINK_TYPES
).freeze
# This is every member of OBJECT_TYPES except Tombstone
TYPE_PARAMS =
{
'Article' => 'articles',
'Audio' => 'audio',
'Document' => 'documents',
'Event' => 'events',
'Image' => 'images',
'Note' => 'notes',
'Page' => 'pages',
'Place' => 'places',
'Profile' => 'profiles',
'Relationship' => 'relationships',
'Video' => 'videos'
}.freeze
DB = Sequel.connect('sqlite://data.db')
Schema.load!
Oj.default_options = { mode: :compat, time_format: :ruby, use_to_json: true }