-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
33 changed files
with
789 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/.bundle/ | ||
/.yardoc | ||
/_yardoc/ | ||
/coverage/ | ||
/doc/ | ||
/pkg/ | ||
/spec/reports/ | ||
/tmp/ | ||
|
||
# rspec failure tracking | ||
.rspec_status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--format documentation | ||
--color | ||
--require spec_helper |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
sudo: false | ||
language: ruby | ||
cache: bundler | ||
rvm: | ||
- 2.4.5 | ||
before_install: gem install bundler -v 1.17.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
source "https://rubygems.org" | ||
|
||
git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } | ||
|
||
# Specify your gem's dependencies in vue_cli-rails.gemspec | ||
gemspec | ||
|
||
gem 'pry-byebug' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
PATH | ||
remote: . | ||
specs: | ||
vue_cli-rails (0.1.0) | ||
activesupport (>= 4.2) | ||
rack-proxy (>= 0.6) | ||
railties (>= 4.2) | ||
|
||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
actionpack (5.2.2) | ||
actionview (= 5.2.2) | ||
activesupport (= 5.2.2) | ||
rack (~> 2.0) | ||
rack-test (>= 0.6.3) | ||
rails-dom-testing (~> 2.0) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.2) | ||
actionview (5.2.2) | ||
activesupport (= 5.2.2) | ||
builder (~> 3.1) | ||
erubi (~> 1.4) | ||
rails-dom-testing (~> 2.0) | ||
rails-html-sanitizer (~> 1.0, >= 1.0.3) | ||
activesupport (5.2.2) | ||
concurrent-ruby (~> 1.0, >= 1.0.2) | ||
i18n (>= 0.7, < 2) | ||
minitest (~> 5.1) | ||
tzinfo (~> 1.1) | ||
builder (3.2.3) | ||
byebug (11.0.0) | ||
coderay (1.1.2) | ||
concurrent-ruby (1.1.4) | ||
crass (1.0.4) | ||
diff-lcs (1.3) | ||
erubi (1.8.0) | ||
i18n (1.5.3) | ||
concurrent-ruby (~> 1.0) | ||
loofah (2.2.3) | ||
crass (~> 1.0.2) | ||
nokogiri (>= 1.5.9) | ||
method_source (0.9.2) | ||
mini_portile2 (2.4.0) | ||
minitest (5.11.3) | ||
nokogiri (1.10.1) | ||
mini_portile2 (~> 2.4.0) | ||
pry (0.12.2) | ||
coderay (~> 1.1.0) | ||
method_source (~> 0.9.0) | ||
pry-byebug (3.7.0) | ||
byebug (~> 11.0) | ||
pry (~> 0.10) | ||
rack (2.0.6) | ||
rack-proxy (0.6.5) | ||
rack | ||
rack-test (1.1.0) | ||
rack (>= 1.0, < 3) | ||
rails-dom-testing (2.0.3) | ||
activesupport (>= 4.2.0) | ||
nokogiri (>= 1.6) | ||
rails-html-sanitizer (1.0.4) | ||
loofah (~> 2.2, >= 2.2.2) | ||
railties (5.2.2) | ||
actionpack (= 5.2.2) | ||
activesupport (= 5.2.2) | ||
method_source | ||
rake (>= 0.8.7) | ||
thor (>= 0.19.0, < 2.0) | ||
rake (10.5.0) | ||
rspec (3.8.0) | ||
rspec-core (~> 3.8.0) | ||
rspec-expectations (~> 3.8.0) | ||
rspec-mocks (~> 3.8.0) | ||
rspec-core (3.8.0) | ||
rspec-support (~> 3.8.0) | ||
rspec-expectations (3.8.2) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.8.0) | ||
rspec-mocks (3.8.0) | ||
diff-lcs (>= 1.2.0, < 2.0) | ||
rspec-support (~> 3.8.0) | ||
rspec-support (3.8.0) | ||
thor (0.20.3) | ||
thread_safe (0.3.6) | ||
tzinfo (1.2.5) | ||
thread_safe (~> 0.1) | ||
|
||
PLATFORMS | ||
ruby | ||
|
||
DEPENDENCIES | ||
bundler (~> 1.16) | ||
pry-byebug | ||
rake (~> 10.0) | ||
rspec (~> 3.0) | ||
vue_cli-rails! | ||
|
||
BUNDLED WITH | ||
1.17.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# VueCli::Rails | ||
|
||
Get `vue-cli` working on Rails | ||
|
||
## Installation | ||
|
||
Add this line to your Rails application's `Gemfile`: | ||
|
||
```ruby | ||
gem 'vue_cli-rails' | ||
``` | ||
|
||
And then execute: | ||
|
||
$ bundle install | ||
$ bundle exec rake vue:create | ||
|
||
> Currently `rake vue:create` will overwrite all files, please be careful! | ||
|
||
Add those lines to your `config/routes.rb`: | ||
|
||
```ruby | ||
get 'vue/foo' => 'vue#foo' | ||
get 'vue/bar' => 'vue#bar' | ||
``` | ||
|
||
## Usage | ||
|
||
This gem is fully depends on `vue-cli`. You can do everything with [`vue.config.js`](https://cli.vuejs.org/config/) just don't break `manifest` plugin which required by `vue_cli-rails`. | ||
|
||
When you starting `rails server` with development mode, `vue-cli-service serve` will be running at the same time. | ||
|
||
Please use `RAILS_ENV=production` to build your production assets. `NODE_ENV` will be ignored! | ||
|
||
You can put `app/assets/vue/manifest.dev.json` into your VCS ignore list. | ||
|
||
## Warning | ||
|
||
Currently `vue.config.js` is reading configurations via `bundle exec rake vue:json_config`. You may suffer performance issue if your rake tasks are slow. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
require "bundler/gem_tasks" | ||
require "rspec/core/rake_task" | ||
|
||
RSpec::Core::RakeTask.new(:spec) | ||
|
||
task :default => :spec |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env ruby | ||
|
||
require "bundler/setup" | ||
require "vue_cli/rails" | ||
|
||
# You can add fixtures and/or initialization code here to make experimenting | ||
# with your gem easier. You can also use a different console, if you like. | ||
|
||
# (If you use this, don't forget to add pry to your Gemfile!) | ||
# require "pry" | ||
# Pry.start | ||
|
||
require "pry" | ||
Pry.start(__FILE__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -euo pipefail | ||
IFS=$'\n\t' | ||
set -vx | ||
|
||
bundle install | ||
|
||
# Do any other automated setup that you need to do here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<template> | ||
<div id="app"> | ||
<slot></slot> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'App', | ||
}; | ||
</script> | ||
|
||
<style> | ||
#app { | ||
box-sizing: border-box; | ||
} | ||
#app * { | ||
box-sizing: border-box; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Vue from 'vue'; | ||
|
||
import App from './App.vue'; | ||
|
||
Vue.config.productionTip = false; | ||
|
||
export default Component => new Vue({ | ||
render: h => h(App, { scopedSlots: { default: () => h(Component) } }), | ||
}).$mount('#app'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<div id="bar"> | ||
<h1>Bar</h1> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Bar', | ||
}; | ||
</script> | ||
|
||
<style> | ||
#bar { | ||
color: blue; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<template> | ||
<div id="foo"> | ||
<h1>Foo</h1> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
export default { | ||
name: 'Foo', | ||
}; | ||
</script> | ||
|
||
<style> | ||
#foo { | ||
color: red | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import launch from '~v-launcher'; | ||
import Bar from '~views/Bar.vue'; | ||
|
||
launch(Bar); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import launch from '~v-launcher'; | ||
import Foo from '~views/Foo.vue'; | ||
|
||
launch(Foo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class VueController < ApplicationController | ||
layout 'vue' | ||
|
||
def foo | ||
end | ||
|
||
def bar | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Vue</title> | ||
<%= csrf_meta_tags %> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<%= yield %> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= vue_entry('bar') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<%= vue_entry('foo') %> |
Oops, something went wrong.