Skip to content
This repository has been archived by the owner on Mar 14, 2022. It is now read-only.

Commit

Permalink
Merge pull request #401 from Financial-Times/no-ruby
Browse files Browse the repository at this point in the history
Swapping scss-lint for sass-lint to drop ruby dependency
  • Loading branch information
JakeChampion authored Nov 16, 2016
2 parents d8d304d + 2a54856 commit 226df0e
Show file tree
Hide file tree
Showing 8 changed files with 157 additions and 470 deletions.
17 changes: 10 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ If you have any issues with OBT, please check out [troubleshooting guide](https:

1. Install these dependencies:
* [node.js](http://nodejs.org/)
* [Ruby](https://www.ruby-lang.org/en/) (Macs typically ship with Ruby by default)

2. Install the build tools globally:

Expand Down Expand Up @@ -55,7 +54,7 @@ All the tasks are built using [gulp](http://gulpjs.com/), and almost all of them
[--buildJs=<file>] Compiled JavaScript file (default: main.js)
[--buildCss=<file>] Compiled CSS file (default: main.css)
[--buildFolder=<dir>] Compiled assets directory (default: ./build/)
[--scssLintPath=<path>] Custom scss-lint configuration
[--sassLintPath=<path>] Custom sass-lint configuration
[--esLintPath=<path>] Custom esLint configuration
[--editorconfigPath=<path>] Custom .editorconfig

Expand All @@ -65,14 +64,12 @@ Install tools and dependencies required to build modules.

Runs:

* __installScssLint()__ globally (if it's not already installed)
* __installBower()__ globally (if it's not already installed)
* __runNpmInstall()__ if there is a `package.json` inthe root directory
* __runBowerInstall()__ using both the Origami Registry and the default Bower registry to resolve dependencies

The versions that are installed and supported are:

* scss-lint: '0.35.0'
* Bower: '^1.3.0'

Config:
Expand Down Expand Up @@ -140,8 +137,8 @@ Lints JavaScript and SCSS against Origami coding standards (see standards for [S

Runs:

* __scssLint(gulp, config)__ Config accepts:
- scssLintPath: `String` Path to your custom 'scss-lint.yml' config file. (Default: 'origami-build-tools/config/scss-lint.yml') _This may be set for product development, but developers of Origami-compliant components are required to accept the default_
* __sassLint(gulp, config)__ Config accepts:
- sassLintPath: `String` Path to your custom 'sass-lint.yml' config file. (Default: 'origami-build-tools/config/sass-lint.yml') _This may be set for product development, but developers of Origami-compliant components are required to accept the default_
- excludeFiles `Array` e.g. `['!**/demo.scss']`
* __esLint(gulp, config)__ Config accepts:
- esLintPath: `String` Path to your custom esLint config file. (Default: 'origami-build-tools/config/.eslintrc' _This may be set for product development, but developers of Origami-compliant components are required to accept the default_
Expand Down Expand Up @@ -219,7 +216,13 @@ OBT gathers analytics data about its usage to help prioritise future development

### Migrating from 5.X.X to 6.X.X

The 6.0.0 release removes the ability for OBT to include the Babel/Core-JS polyfills in the built Javascript. If you were relying on this feature, we recommend that you use the [Polyfill service](https://polyfill.io) instead.
#### OBT build
The 6.0.0 release removes the ability for OBT to include the Babel/Core-JS polyfills in the built Javascript. If you are relying on this feature, we recommend that you use the [Polyfill service](https://polyfill.io) instead.

#### OBT verify
The 6.0.0 release swapped out [`scss-lint`](https://www.npmjs.com/package/gulp-scss-lint) for [`sass-lint`](https://www.npmjs.com/package/gulp-sass-lint).

If you are supplying your own custom scss-lint configuration you need to convert it to an equivalent sass-lint configuration, [here is a tool which can do this for you](https://sasstools.github.io/make-sass-lint-config/). The progammatic API and CLI flag has also changed from `scssLintPath` to `sassLintPath`.

## Licence
This software is published by the Financial Times under the [MIT licence](http://opensource.org/licenses/MIT).
110 changes: 1 addition & 109 deletions TROUBLESHOOT.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ npm should not require root access when installing packages. If you get an `EACC
```

**Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`.

**Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`.

4. Back on the command line, update your system variables:
Expand All @@ -46,111 +46,3 @@ Test: Download a package globally without using sudo.
```bash
npm install -g origami-build-tools
```

### Installing Ruby

We recommend you install Ruby using the `rbenv` version manager instead of using the default Mac or Linux repository versions. This will ensure Ruby Gems have permissions correctly set and allow you to easily migrate to different versions of Ruby.

1. Check out rbenv into `~/.rbenv`.

~~~ sh
$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
~~~

2. Add `~/.rbenv/bin` to your `$PATH` for access to the `rbenv` command-line utility.

~~~ sh
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
~~~

**Ubuntu Desktop note**: Modify your `~/.bashrc` instead of `~/.bash_profile`.

**Zsh note**: Modify your `~/.zshrc` file instead of `~/.bash_profile`.

3. Add `rbenv init` to your shell to enable shims and autocompletion.

~~~ sh
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
~~~

_Same as in previous step, use `~/.bashrc` on Ubuntu, or `~/.zshrc` for Zsh._

4. Restart your shell so that PATH changes take effect. (Opening a new terminal tab will usually do it.) Now check if rbenv was set up:

~~~ sh
$ type rbenv
#=> "rbenv is a function"
~~~

5. Install ruby-build, which provides the `rbenv install` command that simplifies the process of installing new Ruby versions.

~~~ sh
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
~~~

6. Install the latest version of Ruby by checking the [Ruby website](https://www.ruby-lang.org) (2.2.3 as of writing) and avoid jRuby or Rubinius as these haven't been tested with OBT:

~~~ sh
# list all available versions:
$ rbenv install -l

# install the latest version version of Ruby:
$ rbenv install 2.2.3
~~~

7. Use this version of Ruby in all shells:
~~~ sh
$ rbenv global 2.2.3
~~~

### Error `While executing gem ... (Gem::FilePermissionError)`

When installing [SCSS-Lint](https://github.com/causes/scss-lint), depending on how permissions are set on your machine, OBT might fail and return:

>While executing gem ... (Gem::FilePermissionError).
>You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
This can be fixed by following the [Installing Ruby steps](#installing-ruby) mentioned above.

### Error `npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "bower" "--quiet"`

When installing [bower](https://bower.io), depending on how permissions are set on your machine, OBT might fail and return something like this:

>npm ERR! Darwin 14.3.0
>npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "bower" "--quiet"
>npm ERR! node v0.12.2
>npm ERR! npm v2.1.6
>npm ERR! path /usr/local/lib/node_modules/bower
>npm ERR! code EACCES
>npm ERR! errno -13
>
>npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/bower'
>npm ERR! at Error (native)
>npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/bower']
>npm ERR! errno: -13,
>npm ERR! code: 'EACCES',
>npm ERR! path: '/usr/local/lib/node_modules/bower' }
>npm ERR!
>npm ERR! Please try running this command again as root/Administrator.
This can be fixed by following the guide above on [fixing npm permissions](#fix-npm-permissions).

### Warning `Origami registry is not configured in a .bowerrc file`

Origami modules are listed on Origami's custom Bower registry, and aren't available to the global, public one. Custom registries can be added to a `.bowerrc` configuration file located in your home directory. To create a `.bowerrc` configuration file now, run::

```bash
echo '{"registry":{"search":["http://registry.origami.ft.com","https://bower.herokuapp.com"]}}' > ~/.bowerrc
```

### Error `fatal: unable to connect to github.com"`

This can happen if the git protocol is blocked on your network. To get around this you can use the http protocol instead:

```bash
echo -e '[url "http://"]\n insteadOf = git://' >> ~/.gitconfig
```

### Error `Unable to download data from https://rubygems.org/`

If you receive an error specifying `Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (https://api.rubygems.org/specs.4.8.gz)` you'll need to manually update your gem package using the directions in [this gist](https://gist.github.com/luislavena/f064211759ee0f806c88).
Loading

0 comments on commit 226df0e

Please sign in to comment.