omniauth-canvas 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/.rvmrc CHANGED
@@ -3,46 +3,68 @@
3
3
  # This is an RVM Project .rvmrc file, used to automatically load the ruby
4
4
  # development environment upon cd'ing into the directory
5
5
 
6
- # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional,
7
- # Only full ruby name is supported here, for short names use:
8
- # echo "rvm use 1.9.3" > .rvmrc
9
- environment_id="ruby-1.9.3-p194@omniauth-canvas"
10
-
11
- # Uncomment the following lines if you want to verify rvm version per project
12
- # rvmrc_rvm_version="1.12.4 ()" # 1.10.1 seams as a safe start
13
- # eval "$(echo ${rvm_version}.${rvmrc_rvm_version} | awk -F. '{print "[[ "$1*65536+$2*256+$3" -ge "$4*65536+$5*256+$6" ]]"}' )" || {
14
- # echo "This .rvmrc file requires at least RVM ${rvmrc_rvm_version}, aborting loading."
15
- # return 1
16
- # }
6
+ # First we specify our desired <ruby>[@<gemset>], the @gemset name is optional.
7
+ environment_id="ruby-1.9.3@omniauth-canvas"
17
8
 
9
+ #
10
+ # Uncomment following line if you want options to be set only for given project.
11
+ #
12
+ # PROJECT_JRUBY_OPTS=( --1.9 )
13
+ #
14
+ # The variable PROJECT_JRUBY_OPTS requires the following to be run in shell:
15
+ #
16
+ # chmod +x ${rvm_path}/hooks/after_use_jruby_opts
17
+ #
18
+
19
+ #
18
20
  # First we attempt to load the desired environment directly from the environment
19
21
  # file. This is very fast and efficient compared to running through the entire
20
22
  # CLI and selector. If you want feedback on which environment was used then
21
23
  # insert the word 'use' after --create as this triggers verbose mode.
22
- if [[ -d "${rvm_path:-$HOME/.rvm}/environments"
24
+ #
25
+ if [[ -d "${rvm_path:-$HOME/.rvm}/environments" \
23
26
  && -s "${rvm_path:-$HOME/.rvm}/environments/$environment_id" ]]
24
27
  then
25
28
  \. "${rvm_path:-$HOME/.rvm}/environments/$environment_id"
26
- [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]] &&
27
- \. "${rvm_path:-$HOME/.rvm}/hooks/after_use" || true
29
+
30
+ if [[ -s "${rvm_path:-$HOME/.rvm}/hooks/after_use" ]]
31
+ then
32
+ . "${rvm_path:-$HOME/.rvm}/hooks/after_use"
33
+ fi
28
34
  else
29
35
  # If the environment file has not yet been created, use the RVM CLI to select.
30
- rvm --create "$environment_id" || {
36
+ if ! rvm --create "$environment_id"
37
+ then
31
38
  echo "Failed to create RVM environment '${environment_id}'."
32
39
  return 1
33
- }
40
+ fi
34
41
  fi
35
42
 
43
+ #
44
+ # If you use an RVM gemset file to install a list of gems (*.gems), you can have
45
+ # it be automatically loaded. Uncomment the following and adjust the filename if
46
+ # necessary.
47
+ #
48
+ # filename=".gems"
49
+ # if [[ -s "$filename" ]]
50
+ # then
51
+ # rvm gemset import "$filename" | grep -v already | grep -v listed | grep -v complete | sed '/^$/d'
52
+ # fi
53
+
36
54
  # If you use bundler, this might be useful to you:
37
- # if [[ -s Gemfile ]] && {
38
- # ! builtin command -v bundle >/dev/null ||
39
- # builtin command -v bundle | grep $rvm_path/bin/bundle >/dev/null
40
- # }
55
+ # if [[ -s Gemfile ]] && ! command -v bundle >/dev/null
41
56
  # then
42
- # printf "%b" "The rubygem 'bundler' is not installed. Installing it now.\n"
57
+ # printf "The rubygem 'bundler' is not installed. Installing it now.\n"
43
58
  # gem install bundler
44
59
  # fi
45
- # if [[ -s Gemfile ]] && builtin command -v bundle >/dev/null
60
+ # if [[ -s Gemfile ]] && command -v bundle
46
61
  # then
47
- # bundle install | grep -vE '^Using|Your bundle is complete'
62
+ # bundle install
48
63
  # fi
64
+
65
+ if [[ $- == *i* ]] # check for interactive shells
66
+ then
67
+ echo "Using: $(tput setaf 2)$GEM_HOME$(tput sgr0)" # show the user the ruby and gemset they are using in green
68
+ else
69
+ echo "Using: $GEM_HOME" # don't use colors in interactive shells
70
+ fi
data/README.md CHANGED
@@ -11,6 +11,8 @@ authenticate with http://canvas.instructure.com. To dynamically set the canvas s
11
11
 
12
12
  ## Standard setup:
13
13
 
14
+ # NOTE that you will need to set env['rack.session']['oauth_site'] to the current Canvas instance that you wish to OAuth with. By default this is https://canvas.instructure.com
15
+
14
16
  use OmniAuth::Builder do
15
17
  provider :canvas, :setup => lambda{|env|
16
18
  request = Rack::Request.new(env)
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Canvas
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -11,6 +11,9 @@ module OmniAuth
11
11
  :authorize_url => "/login/oauth2/auth",
12
12
  :token_url => "/login/oauth2/token"
13
13
  }
14
+
15
+ option :provider_ignores_state, true
16
+
14
17
  option :token_params, {
15
18
  :parse => :json
16
19
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-canvas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-18 00:00:00.000000000 Z
12
+ date: 2013-03-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth