Skip to content

Commit

Permalink
Some perl6 -> raku
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbkr committed Apr 21, 2022
1 parent bcc4c81 commit ccacf63
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
20 changes: 10 additions & 10 deletions README.md
@@ -1,4 +1,4 @@
# perl6-WebService-GitHub
# WebService-GitHub


*ALPHA STAGE, SUBJECT TO CHANGE*
Expand Down Expand Up @@ -55,7 +55,7 @@ UTC by default, [Doc](https://developer.github.com/v3/#timezones)

Builds the object with a particular role

```perl6
```raku
my $gh = WebService::GitHub.new(
with => ('Debug')
);
Expand Down Expand Up @@ -91,20 +91,20 @@ Some of them are, or will be, included in the `examples` directory.

#### get user info

```perl6
```raku
my $gh = WebService::GitHub.new;
my $user = $gh.request('/users/fayland').data;
say $user<name>;
```

#### search repositories

```perl6
```raku
use WebService::GitHub::Search;

my $search = WebService::GitHub::Search.new;
my $data = $search.repositories({
:q<perl6>,
:q<raku>,
:sort<stars>,
:order<desc>
}).data;
Expand All @@ -116,7 +116,7 @@ my $data = $search.repositories({

[examples/create_access_token.pl](examples/create_access_token.pl)

```perl6
```raku
use WebService::GitHub::OAuth;

my $gh = WebService::GitHub::OAuth.new(
Expand All @@ -135,15 +135,15 @@ say $auth<token>;

#### create a gist

```perl6
```raku
use WebService::GitHub::Gist;

my $gist = WebService::GitHub::Gist.new(
access-token => %*ENV<GITHUB_ACCESS_TOKEN>
);

my $data = $gist.create_gist({
description => 'Test from perl6 WebService::GitHub::Gist',
description => 'Test from WebService::GitHub::Gist',
public => True,
files => {
'test.txt' => {
Expand All @@ -156,7 +156,7 @@ say $data<url>;

#### update gist

```perl6
```raku
$data = $gist.update_gist($id, {
files => {
"test_another.txt" => {
Expand All @@ -168,7 +168,7 @@ $data = $gist.update_gist($id, {

#### delete gist

```perl6
```raku
$res = $gist.delete_gist($id);
say 'Deleted' if $res.is-success;
```
2 changes: 1 addition & 1 deletion dev-scripts/static/lib/WebService/GitHub/Role.rakumod
Expand Up @@ -30,7 +30,7 @@ role WebService::GitHub::Role {
has WebService::GitHub::AppAuth $!app-auth is built;
has $!install-id is built;

has $.useragent = 'perl6-WebService-GitHub/0.1.0';
has $.useragent = 'Raku-WebService-GitHub';
has $.ua = HTTP::UserAgent.new;

has $.cache = Cache::LRU.new(size => 200);
Expand Down
8 changes: 4 additions & 4 deletions dev-scripts/static/t/12-issues.t
Expand Up @@ -9,12 +9,12 @@ my $github = WebService::GitHub.new;
if ((%*ENV<TRAVIS> && $github.rate-limit-remaining()) || %*ENV<GH_TOKEN>) {
diag "running on travis or with token";
my $gh = WebService::GitHub::Issues.new;
my $issues = $gh.show(repo => 'fayland/perl6-WebService-GitHub').data;
my $issuesd = $github.issues.show(repo => 'fayland/perl6-WebService-GitHub').data;
my $issues = $gh.show(repo => 'raku-community-modules/WebService-GitHub').data;
my $issuesd = $github.issues.show(repo => 'raku-community-modules/WebService-GitHub').data;
cmp-ok $issues.elems, ">", 0, "Non-null number of issues";
cmp-ok $issuesd.elems, ">", 0, "Non-null number of issues - from \$github.issues";
my $first-issue = $gh.single-issue(repo => 'fayland/perl6-WebService-GitHub', issue => 1).data;
my $first-issued = $github.issues.single-issue(repo => 'fayland/perl6-WebService-GitHub', issue => 1).data;
my $first-issue = $gh.single-issue(repo => 'raku-community-modules/WebService-GitHub', issue => 1).data;
my $first-issued = $github.issues.single-issue(repo => 'raku-community-modules/WebService-GitHub', issue => 1).data;
is $first-issue<created_at>, "2015-10-26T19:45:45Z", "First issue OK";
is $first-issued<created_at>, "2015-10-26T19:45:45Z", "First issue OK - from \$github.issues";
my @all-issues = $gh.all-issues('JJ/perl6em');
Expand Down
2 changes: 1 addition & 1 deletion examples/create_access_token.pl
@@ -1,4 +1,4 @@
#!/usr/bin/env perl6
#!/usr/bin/env raku

use v6;

Expand Down

0 comments on commit ccacf63

Please sign in to comment.