siteleaf 2.1.2 → 2.2.1

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: 7632e9291c8a7111f572ac0380262e85d8ed86791fad2baa9ac7ef4bdea37973
4
- data.tar.gz: 280efe8fe737f575fee142871d0b77334f5ee03e84e3d1613b42b5daa65c08c3
3
+ metadata.gz: ce6fc710cfc1acbebaf8d32fd7b2fd8a71d4214a927f3044123f83379edd39ca
4
+ data.tar.gz: 230fb95a0b07b80a64bfe9327ea91a29c7666bbb30451f213c54954b1363e32d
5
5
  SHA512:
6
- metadata.gz: 6d641ff9b139f5ea7c49beb1bcab152fe19dde0996e3043cf3e137d0ba41488ff4f8250e47bd41042d0e5d35c36b9df11df845981cfc55438ba4d90e35a4c260
7
- data.tar.gz: fe6f49d7ad52adce8522b35c77775e85b2170e327dd442fba6a043cf2b0f4482008643a3be544641e1480ae47293fec544e316feeb928bb503f00d94814d06f6
6
+ metadata.gz: ea19934dd0aea81f63d0e92369d757888011cbd951c015b7e69de6b3813e3774e69fd5bcff527b9207f610b29f7a1f4bd1ba894e99342090e273b539bbd4a5f9
7
+ data.tar.gz: 0a72065cf23659cbe5efa2beea7590588bcd22235ce00f42e4be3a3fb4084ab5671f258dd025427e2db48cb4690d11d29635a5f8a2a2617cd628b5093e64d380
data/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  <img alt="Siteleaf" src="https://learn.siteleaf.com/assets/images/logo.svg" width="10%">
2
2
 
3
- Siteleaf v2 Gem
4
- ===============
3
+ Siteleaf v2 Gem & CLI
4
+ =====================
5
5
 
6
6
  - [Prerequisites](#prerequisites)
7
7
  - [Installation](#installation)
@@ -0,0 +1,12 @@
1
+ module Siteleaf
2
+ class Role < Entity
3
+
4
+ attr_accessor :kind, :user_id, :site_id
5
+ attr_reader :id, :created_at, :updated_at
6
+
7
+ def create_endpoint
8
+ "sites/#{site_id}/roles"
9
+ end
10
+
11
+ end
12
+ end
data/lib/siteleaf/site.rb CHANGED
@@ -48,6 +48,11 @@ module Siteleaf
48
48
  Job.new(id: result["job_id"]) if result
49
49
  end
50
50
 
51
+ def users
52
+ result = Client.get "#{entity_endpoint}/users"
53
+ result.map { |r| User.new(r) } if result.is_a? Array
54
+ end
55
+
51
56
  def full_url
52
57
  "http://#{domain}"
53
58
  end
@@ -5,7 +5,7 @@ module Siteleaf
5
5
  attr_reader :name, :url, :download_url, :type, :filesize, :sha, :created_at, :updated_at, :user_id
6
6
 
7
7
  def create_endpoint
8
- uri = URI.encode(identifier)
8
+ uri = URI::Parser.new.escape(identifier)
9
9
  uri = uri.gsub('[', '%5B').gsub(']', '%5D') # workaround for https://bugs.ruby-lang.org/issues/12235
10
10
  ::File.join('sites', site_id, 'source', uri)
11
11
  end
@@ -1,3 +1,3 @@
1
1
  module Siteleaf
2
- VERSION = "2.1.2"
2
+ VERSION = "2.2.1"
3
3
  end
data/lib/siteleaf.rb CHANGED
@@ -14,6 +14,7 @@ require 'siteleaf/document'
14
14
  require 'siteleaf/site'
15
15
  require 'siteleaf/source_file'
16
16
  require 'siteleaf/user'
17
+ require 'siteleaf/role'
17
18
  require 'digest/sha1'
18
19
  require 'rbconfig'
19
20
  require 'uri'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: siteleaf
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.2
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Siteleaf
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-24 00:00:00.000000000 Z
11
+ date: 2023-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -91,6 +91,7 @@ files:
91
91
  - lib/siteleaf/git_hash.rb
92
92
  - lib/siteleaf/job.rb
93
93
  - lib/siteleaf/page.rb
94
+ - lib/siteleaf/role.rb
94
95
  - lib/siteleaf/site.rb
95
96
  - lib/siteleaf/source_file.rb
96
97
  - lib/siteleaf/user.rb
@@ -115,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
116
  - !ruby/object:Gem::Version
116
117
  version: '0'
117
118
  requirements: []
118
- rubygems_version: 3.1.4
119
+ rubygems_version: 3.2.32
119
120
  signing_key:
120
121
  specification_version: 4
121
122
  summary: Siteleaf Ruby interface