notion_ruby_mapping 0.7.5 → 0.7.7

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
  SHA256:
3
- metadata.gz: f757b8eab76be0d30120c595afffc53dba4cde99a872c53eae58334d6d1ecd73
4
- data.tar.gz: d342baef240aaf0cbabc1b9fe298eb99216367e72eeb9c0ed49f15bc58ffc930
3
+ metadata.gz: 03a125f454d083e662faf00778b9181e386846628e3d0bf6fa068e2cbd05a513
4
+ data.tar.gz: f536e72b18ea0b701a2f4e7bad4fbde352e59eabc8f848b72c438226b562c58a
5
5
  SHA512:
6
- metadata.gz: 4e043303f49438475ef9ef87b2e7d91af74105bf2069286986d9727622e4056c8e9ab6921b3c06c55f24a3c10ad6ecb9b103fec88ddb3f90fde482fad6fc90dd
7
- data.tar.gz: 30934684ec64206c5fcb6123dea99fdaa6fd3721ecb3ace0a1574980e2c93eb4ee4d2574f09c9eefb98a5b01fce761b2c4c09e5ab7a8b46f36d9bd3714615cee
6
+ metadata.gz: ebdf167f99b33960ffd125f59f6b5008d7cbbad548bbb044499408dbbdc81ed989c5358733ea126202e40f6142a21265cde46e511e50718caeb204af1221778c
7
+ data.tar.gz: cc069fabc9bdfbd92f0ac1b086ebde7742974d692616798ceed29b89f8388bbbd3bf487e3ecb58d28819e3fcc657bbdc8d3c4dce8be315c432c4fa6d00a7bd3e
data/README.md CHANGED
@@ -127,6 +127,8 @@ NotionRubyMapping.configuration { |c| c.notion_token = ENV["NOTION_API_TOKEN"] }
127
127
 
128
128
  ## 3. ChangeLog
129
129
 
130
+ - 2023/4/14 [v0.7.7] add token= method for Notion API book typo
131
+ - 2023/4/1 [v0.7.6] bug fix Ignore last ? option for page_id
130
132
  - 2023/3/8 [v0.7.5] add notionTimeRecorder.rb
131
133
  - 2023/2/9 [v0.7.4] bug fix for rollup property of erdToNotionRb.rb script
132
134
  - 2023/1/26 [v0.7.3] release beta version of erdToNotionRb.rb script
@@ -76,7 +76,7 @@ module NotionRubyMapping
76
76
 
77
77
  def self.page_id(str)
78
78
  if /^http/.match str
79
- /([\da-f]{32})$/.match(str)[1]
79
+ /([\da-f]{32})(|\?.*)$/.match(str)[1]
80
80
  else
81
81
  NotionCache.instance.hex_id str
82
82
  end
@@ -272,6 +272,11 @@ module NotionRubyMapping
272
272
  def search_path
273
273
  "v1/search"
274
274
  end
275
+
276
+ # @param [String] token
277
+ def token=(token)
278
+ @notion_token = token
279
+ end
275
280
 
276
281
  def update_block_request(block_id, payload)
277
282
  request :patch, block_path(block_id), payload
@@ -11,6 +11,8 @@ module NotionRubyMapping
11
11
  # @return [String, nil] iso8601 format string
12
12
  def self.value_str(obj, start_time: false, end_time: false)
13
13
  case obj
14
+ when DateTime
15
+ obj.iso8601
14
16
  when Date
15
17
  tz = Time.now.strftime "%:z"
16
18
  ds = obj.iso8601
@@ -23,8 +25,6 @@ module NotionRubyMapping
23
25
  end
24
26
  when Time
25
27
  obj.strftime("%Y-%m-%dT%H:%M:%S%:z")
26
- when DateTime
27
- obj.iso8601
28
28
  else
29
29
  obj
30
30
  end
@@ -49,7 +49,7 @@ module NotionRubyMapping
49
49
  # @return [NotionRubyMapping::Query] generated Query object
50
50
  # @see https://www.notion.so/hkob/CheckboxProperty-ac1edbdb8e264af5ad1432b522b429fd#5f07c4ebc4744986bfc99a43827349fc
51
51
  def filter_equals(date, condition: nil, another_type: nil)
52
- if date.is_a? Date
52
+ if date.class == Date
53
53
  start_date, end_date = self.class.start_end_time date
54
54
  if condition
55
55
  filter_after(start_date, condition: condition, another_type: another_type)
@@ -67,7 +67,7 @@ module NotionRubyMapping
67
67
  # @param [String] another_type Rollup type
68
68
  # @return [NotionRubyMapping::Query] generated Query object
69
69
  def filter_does_not_equal(date, condition: nil, another_type: nil)
70
- if date.is_a? Date
70
+ if date.class == Date
71
71
  start_date, end_date = self.class.start_end_time date
72
72
  if condition
73
73
  filter_before(start_date, condition: condition, another_type: another_type)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NotionRubyMapping
4
- VERSION = "0.7.5"
4
+ VERSION = "0.7.7"
5
5
  NOTION_VERSION = "2022-06-28"
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: notion_ruby_mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.5
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hiroyuki KOBAYASHI
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-03-08 00:00:00.000000000 Z
11
+ date: 2023-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -278,7 +278,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
278
278
  - !ruby/object:Gem::Version
279
279
  version: '0'
280
280
  requirements: []
281
- rubygems_version: 3.4.7
281
+ rubygems_version: 3.4.6
282
282
  signing_key:
283
283
  specification_version: 4
284
284
  summary: Notion Ruby mapping tool