pixelpro_sdk 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 3dc4c25ea37be76bf18e42c0302a746253a6221e
4
+ data.tar.gz: ed2861c2cc8e529dc321443a977e535d236b442d
5
+ SHA512:
6
+ metadata.gz: 5322371f6e471292dcca512385dd98b358228291736341326fb73c2daf189b365064810134f198b18c8534fa6f7acae6b8c061cffd4f11cb8478a8ba42cbc887
7
+ data.tar.gz: f32258cfad38f7cbcb0f2b068dab7cfd40b2e1f42960edd43a6b7b00ee17d36c9fdf6ec1a9ccbca9ca4b510e61eb293f5b22728ac440295a41187a88e3a87945
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
data/Gemfile ADDED
@@ -0,0 +1,26 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in pixelpro_sdk.gemspec
4
+ gemspec
5
+
6
+ rails_version = ENV["RAILS_VERSION"] || "default"
7
+ case rails_version
8
+ when "master"
9
+ rails = { github: "rails/rails" }
10
+ gem 'sass-rails', '>= 4.0.2'
11
+ when "default"
12
+ rails = ">= 3.1.0"
13
+ gem 'sass-rails'
14
+ else
15
+ rails = "~> #{rails_version}"
16
+
17
+ if rails_version[0] == '4'
18
+ gem 'sass-rails', '>= 4.0.2'
19
+ else
20
+ gem 'sass-rails'
21
+ end
22
+ end
23
+
24
+ gem 'rails', rails
25
+ gem 'uglifier'
26
+ gem 'thor'
data/README ADDED
File without changes
data/README.md ADDED
@@ -0,0 +1,35 @@
1
+ # PixelproSdk
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/pixelpro_sdk`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'pixelpro_sdk'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install pixelpro_sdk
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/pixelpro_sdk. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "pixelpro_sdk"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
data/exe/pixelpro_init ADDED
@@ -0,0 +1,13 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "rails"
4
+ require "thor"
5
+ require "bundler/setup"
6
+ require "pixelpro_sdk"
7
+
8
+ name = "pixel"
9
+ name = ARGV.first if ARGV.first
10
+
11
+ pixel_controller = PixelproSdk::AddPage.new
12
+ pixel_controller.add_controller_file name
13
+ pixel_controller.append_route name
@@ -0,0 +1,53 @@
1
+ require "thor"
2
+
3
+ module PixelproSdk
4
+ class AddPage < Thor::Group
5
+ include Thor::Actions
6
+
7
+ def self.source_root
8
+ File.dirname(__FILE__)
9
+ end
10
+
11
+ def add_controller_file name
12
+ create_file "app/controller/#{name}_controller.rb" do
13
+ "class CarRestrictionController < ApplicationController\n
14
+ skip_before_action :verify_authenticity_token\n
15
+ def config_ui
16
+ # Add your codes here
17
+ end
18
+
19
+ def ins
20
+ # Add your codes here
21
+ end
22
+
23
+ def info
24
+ # Add your codes here
25
+ end
26
+
27
+ def event
28
+ # Add your codes here
29
+ end\nend\n"
30
+ end
31
+ end
32
+
33
+ def append_route name
34
+ if (::File.exist? "config/routes.rb")
35
+ append_to_file "config/routes.rb" do
36
+ "Rails.application.routes.draw do
37
+ get 'info' => '#{name}#info'
38
+ get 'event' => '#{name}#event'
39
+ get 'config' => '#{name}#config_ui'
40
+ post 'ins' => '#{name}#ins'
41
+ end\n"
42
+ end
43
+ else
44
+ raise "No Routes File Found"
45
+ end
46
+ end
47
+
48
+ def add_migrate_file
49
+ execute :bundle, "rails generate migration CreatePixel pixel_uid:string user_id:integer"
50
+ end
51
+
52
+ end
53
+ end
@@ -0,0 +1,20 @@
1
+ class CarRestrictionController < ApplicationController
2
+
3
+ skip_before_action :verify_authenticity_token
4
+
5
+ def config_ui
6
+ # Add your codes here
7
+ end
8
+
9
+ def ins
10
+ # Add your codes here
11
+ end
12
+
13
+ def info
14
+ # Add your codes here
15
+ end
16
+
17
+ def event
18
+ # Add your codes here
19
+ end
20
+ end
@@ -0,0 +1,3 @@
1
+ module PixelproSdk
2
+ VERSION = "0.1.0"
3
+ end
@@ -0,0 +1,9 @@
1
+ require "pixelpro_sdk/version"
2
+ require "pixelpro_sdk/page"
3
+ require "thor"
4
+
5
+ module PixelproSdk
6
+ # Your code goes here...
7
+
8
+
9
+ end
@@ -0,0 +1,37 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'pixelpro_sdk/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "pixelpro_sdk"
8
+ spec.version = PixelproSdk::VERSION
9
+ spec.authors = ["zhaolin"]
10
+ spec.email = ["zhaodamon@gmail.com"]
11
+
12
+ spec.summary = %q{"Pixel Pro Service SDK"}
13
+ spec.description = %q{"This gem will help you to build your Pixel Service in Ruby"}
14
+ spec.homepage = "https://github.com/zhaolin1992/pixelpro_sdk_ruby"
15
+
16
+ # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
17
+ # delete this section to allow pushing this gem to any host.
18
+ if spec.respond_to?(:metadata)
19
+ spec.metadata['allowed_push_host'] = "https://rubygems.org"
20
+ else
21
+ raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
22
+ end
23
+
24
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.files << Dir['lib/**/*.rb']
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
+ spec.executables << 'pixelpro_init'
29
+ spec.require_paths = ["lib"]
30
+
31
+ spec.add_development_dependency "bundler", "~> 1.10"
32
+ spec.add_development_dependency "rake", "~> 10.0"
33
+
34
+ spec.add_runtime_dependency "railties", ">= 3.1.0"
35
+ spec.add_runtime_dependency "thor", "~> 0.19.1"
36
+
37
+ end
metadata ADDED
@@ -0,0 +1,115 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: pixelpro_sdk
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - zhaolin
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2016-01-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: railties
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: 3.1.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: 3.1.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: thor
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 0.19.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 0.19.1
69
+ description: '"This gem will help you to build your Pixel Service in Ruby"'
70
+ email:
71
+ - zhaodamon@gmail.com
72
+ executables:
73
+ - pixelpro_init
74
+ extensions: []
75
+ extra_rdoc_files: []
76
+ files:
77
+ - ".gitignore"
78
+ - CODE_OF_CONDUCT.md
79
+ - Gemfile
80
+ - README
81
+ - README.md
82
+ - Rakefile
83
+ - bin/console
84
+ - bin/setup
85
+ - exe/pixelpro_init
86
+ - lib/pixelpro_sdk.rb
87
+ - lib/pixelpro_sdk/page.rb
88
+ - lib/pixelpro_sdk/templates/template_controller.rb
89
+ - lib/pixelpro_sdk/version.rb
90
+ - pixelpro_sdk.gemspec
91
+ homepage: https://github.com/zhaolin1992/pixelpro_sdk_ruby
92
+ licenses: []
93
+ metadata:
94
+ allowed_push_host: https://rubygems.org
95
+ post_install_message:
96
+ rdoc_options: []
97
+ require_paths:
98
+ - lib
99
+ required_ruby_version: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ required_rubygems_version: !ruby/object:Gem::Requirement
105
+ requirements:
106
+ - - ">="
107
+ - !ruby/object:Gem::Version
108
+ version: '0'
109
+ requirements: []
110
+ rubyforge_project:
111
+ rubygems_version: 2.2.2
112
+ signing_key:
113
+ specification_version: 4
114
+ summary: '"Pixel Pro Service SDK"'
115
+ test_files: []